diff options
Diffstat (limited to 'pcap-netfilter-linux.c')
-rw-r--r-- | pcap-netfilter-linux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pcap-netfilter-linux.c b/pcap-netfilter-linux.c index 2a5812b2..c086d949 100644 --- a/pcap-netfilter-linux.c +++ b/pcap-netfilter-linux.c @@ -127,7 +127,7 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c const unsigned char *payload = NULL; struct pcap_pkthdr pkth; - const struct nfgenmsg *nfg; + const struct nfgenmsg *nfg = NULL; int id = 0; if (handle->linktype != DLT_NFLOG) { @@ -194,6 +194,8 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c if (type == NFQUEUE) { /* XXX, possible responses: NF_DROP, NF_ACCEPT, NF_STOLEN, NF_QUEUE, NF_REPEAT, NF_STOP */ + /* if type == NFQUEUE, handle->linktype is always != DLT_NFLOG, + so nfg is always initialized to NLMSG_DATA(nlh). */ nfqueue_send_verdict(handle, ntohs(nfg->res_id), id, NF_ACCEPT); } } |