nfqws: add nfq_bind_pf(AF_INET6) for kernels <3.7

This commit is contained in:
bol-van
2020-03-18 20:40:12 +03:00
parent 0efc4f7b24
commit 1978e8f4ab
9 changed files with 10 additions and 0 deletions

View File

@@ -517,12 +517,22 @@ int main(int argc, char **argv)
fprintf(stderr, "error during nfq_unbind_pf()\n");
goto exiterr;
}
printf("unbinding existing nf_queue handler for AF_INET6 (if any)\n");
if (nfq_unbind_pf(h, AF_INET6) < 0) {
fprintf(stderr, "error during nfq_unbind_pf()\n");
// ignore error. system can be without ipv6
}
printf("binding nfnetlink_queue as nf_queue handler for AF_INET\n");
if (nfq_bind_pf(h, AF_INET) < 0) {
fprintf(stderr, "error during nfq_bind_pf()\n");
goto exiterr;
}
printf("binding nfnetlink_queue as nf_queue handler for AF_INET6\n");
if (nfq_bind_pf(h, AF_INET6) < 0) {
fprintf(stderr, "error during nfq_bind_pf()\n");
// ignore error. system can be without ipv6
}
printf("binding this socket to queue '%u'\n", params.qnum);
qh = nfq_create_queue(h, params.qnum, &cb, &params);