Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

nfqws2: add comment

This commit is contained in:
bol-van
2026-02-22 19:41:08 +03:00
parent 37f45a132f
commit 59b3734643

View File

@@ -266,6 +266,10 @@ static int nfq_cb(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_da
mark = nfq_get_nfmark(nfa); mark = nfq_get_nfmark(nfa);
ilen = nfq_get_payload(nfa, &data); ilen = nfq_get_payload(nfa, &data);
// if_indextoname creates socket, calls ioctl, closes socket
// code below prevents socket() and close() syscalls on every packet
// this saves CPU 5-10 times
*ifr_out.ifr_name = 0; *ifr_out.ifr_name = 0;
ifr_out.ifr_ifindex = nfq_get_outdev(nfa); ifr_out.ifr_ifindex = nfq_get_outdev(nfa);
if (ifr_out.ifr_ifindex && ioctl(cbdata->sock, SIOCGIFNAME, &ifr_out)<0) if (ifr_out.ifr_ifindex && ioctl(cbdata->sock, SIOCGIFNAME, &ifr_out)<0)