bugfix: close fd_fake_c/fd_fake_s on error

This commit is contained in:
luwenpeng
2023-05-22 16:03:06 +08:00
parent fc2625c691
commit e1b16ee339

View File

@@ -800,6 +800,14 @@ static int payload_handler_cb(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, s
return nfq_set_verdict(qh, id, NF_ACCEPT, pktinfo.ip_totlen, raw_payload); return nfq_set_verdict(qh, id, NF_ACCEPT, pktinfo.ip_totlen, raw_payload);
end: end:
if (fd_fake_c > 0)
{
close(fd_fake_c);
}
if (fd_fake_s > 0)
{
close(fd_fake_s);
}
if (fd_upstream > 0) if (fd_upstream > 0)
{ {
TFE_PROXY_STAT_INCREASE(STAT_FD_CLOSE_BY_KNI_ACCEPT_FAIL, 1); TFE_PROXY_STAT_INCREASE(STAT_FD_CLOSE_BY_KNI_ACCEPT_FAIL, 1);