]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-linux.c
New filter "ifindex" for LINUX_SLL2 and live Linux captures
[libpcap] / pcap-linux.c
index a783aabac5029e465e84f2c27564f6778e423b0a..bf0bc812bc257dec2ecbe813913a5658b90f798a 100644 (file)
@@ -5923,6 +5923,12 @@ fix_offset(pcap_t *handle, struct bpf_insn *p)
                         * special magic kernel offset for that field.
                         */
                        p->k = SKF_AD_OFF + SKF_AD_PROTOCOL;
+               } else if (p->k == 4) {
+                       /*
+                        * It's the ifindex field; map it to the
+                        * special magic kernel offset for that field.
+                        */
+                       p->k = SKF_AD_OFF + SKF_AD_IFINDEX;
                } else if (p->k == 10) {
                        /*
                         * It's the packet type field; map it to the