Merging upstream version 2.1.2.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-08 12:11:55 +01:00
parent e291a3b166
commit 9426e488c9
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
5 changed files with 36 additions and 15 deletions

View file

@ -77,6 +77,8 @@ tcpstate_ptr tcpstate_find(iaddr from, iaddr to, unsigned sport, unsigned dport,
return tcpstate;
}
tcpstate_ptr _curr_tcpstate = 0;
tcpstate_ptr tcpstate_new(iaddr from, iaddr to, unsigned sport, unsigned dport)
{
tcpstate_ptr tcpstate = calloc(1, sizeof *tcpstate);
@ -87,6 +89,13 @@ tcpstate_ptr tcpstate_new(iaddr from, iaddr to, unsigned sport, unsigned dport)
tcpstate = TAIL(tcpstates);
assert(tcpstate != NULL);
UNLINK(tcpstates, tcpstate, link);
if (tcpstate->reasm) {
tcpreasm_free(tcpstate->reasm);
}
if (_curr_tcpstate == tcpstate) {
_curr_tcpstate = 0;
}
memset(tcpstate, 0, sizeof(*tcpstate));
} else {
tcpstate_count++;
}
@ -99,8 +108,6 @@ tcpstate_ptr tcpstate_new(iaddr from, iaddr to, unsigned sport, unsigned dport)
return tcpstate;
}
tcpstate_ptr _curr_tcpstate = 0;
tcpstate_ptr tcpstate_getcurr(void)
{
return _curr_tcpstate;