]> The Tcpdump Group git mirrors - libpcap/commitdiff
NFLOG: don't crash trying to filter at link layer
authorDenis Ovsienko <[email protected]>
Thu, 5 Dec 2013 10:54:14 +0000 (14:54 +0400)
committerDenis Ovsienko <[email protected]>
Thu, 5 Dec 2013 10:59:40 +0000 (14:59 +0400)
Before:

@ tcpdump -i nflog icmp
tcpdump: WARNING: SIOCGIFADDR: nflog: No such device
Aborted (core dumped)

After:

@ tcpdump -i nflog icmp
tcpdump: WARNING: SIOCGIFADDR: nflog: No such device
tcpdump: NFLOG link-layer type filtering not implemented

gencode.c

index 7bb07fb1130d1db1ffcfa7d0c7bf67cdd50deb80..d58ea307e75602d25b92b978c5c4bb5b406029e1 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -3410,6 +3410,13 @@ gen_linktype(proto)
 
        case DLT_AX25_KISS:
                bpf_error("AX.25 link-layer type filtering not implemented");
+
+       case DLT_NFLOG:
+               /* Using the fixed-size NFLOG header it is possible to tell only
+                * the address family of the packet, other meaningful data is
+                * either missing or behind TLVs.
+                */
+               bpf_error("NFLOG link-layer type filtering not implemented");
        }
 
        /*