]> The Tcpdump Group git mirrors - libpcap/blobdiff - gencode.c
Add a pcap/ipnet.h file with IPNET definitions; use the right AF_ values.
[libpcap] / gencode.c
index 629ef5c7566ffd9386037c4458b4036a20071baa..b0abe00927c810fdc63a18fbaa94ecb3b96b13d6 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -74,6 +74,7 @@ static const char rcsid[] _U_ =
 #include "sunatmpos.h"
 #include "ppp.h"
 #include "pcap/sll.h"
+#include "pcap/ipnet.h"
 #include "arcnet.h"
 #ifdef HAVE_NET_PFVAR_H
 #include <sys/socket.h>
@@ -2021,16 +2022,18 @@ gen_ipnet_linktype(proto)
        register int proto;
 {
        switch (proto) {
+
        case ETHERTYPE_IP:
                return gen_cmp(OR_LINK, off_linktype, BPF_B,
-                   (bpf_int32)AF_INET);
+                   (bpf_int32)IPH_AF_INET);
                /* NOTREACHED */
 
        case ETHERTYPE_IPV6:
                return gen_cmp(OR_LINK, off_linktype, BPF_B,
-                   (bpf_int32)AF_INET6);
+                   (bpf_int32)IPH_AF_INET6);
                /* NOTREACHED */
-       default :
+
+       default:
                break;
        }