- TCP option release added
This commit is contained in:
parent
b39f302a63
commit
f0ddddefad
@ -275,6 +275,11 @@ int tcp_receive_segment_cb(const Pckt *pckt, PcktSieveLayerTag tag) {
|
|||||||
// maintain retry counter
|
// maintain retry counter
|
||||||
tcps->retries = willRetry ? (tcps->retries + 1) : 0;
|
tcps->retries = willRetry ? (tcps->retries + 1) : 0;
|
||||||
|
|
||||||
|
// release options if not NULL
|
||||||
|
if (tcpProps->options != NULL) {
|
||||||
|
tcpopt_chain_free(tcpProps->options);
|
||||||
|
}
|
||||||
|
|
||||||
// release descriptor if not meaningful anymore
|
// release descriptor if not meaningful anymore
|
||||||
if (ret == SIEVE_LAYER_REMOVE_THIS) {
|
if (ret == SIEVE_LAYER_REMOVE_THIS) {
|
||||||
cbdt_release(E.cbdt, tcps->d); // release descriptor
|
cbdt_release(E.cbdt, tcps->d); // release descriptor
|
||||||
|
@ -205,4 +205,13 @@ TcpOption *tcpopt_new(uint32_t kind, uint32_t size) {
|
|||||||
return opt;
|
return opt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tcpopt_chain_free(const TcpOption * opt) {
|
||||||
|
const TcpOption * iter = opt, *next;
|
||||||
|
while (iter) {
|
||||||
|
next = iter->next;
|
||||||
|
dynmem_free(iter);
|
||||||
|
iter = next;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,12 @@ typedef struct TcpOption_ {
|
|||||||
*/
|
*/
|
||||||
TcpOption * tcpopt_new(uint32_t kind, uint32_t size);
|
TcpOption * tcpopt_new(uint32_t kind, uint32_t size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release a chain of TCP options
|
||||||
|
* @param opt pointer to the chain's first element to release
|
||||||
|
*/
|
||||||
|
void tcpopt_chain_free(const TcpOption * opt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TCP segment properties.
|
* TCP segment properties.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user