]> The Tcpdump Group git mirrors - libpcap/commitdiff
Don't fail if netfilter isn't enabled in the kernel.
authorJiri Slaby <[email protected]>
Wed, 29 Feb 2012 09:19:18 +0000 (01:19 -0800)
committerGuy Harris <[email protected]>
Wed, 29 Feb 2012 09:19:18 +0000 (01:19 -0800)
Check for EPROTONOSUPPORT as well as EAFNOSUPPORT.

Reviewed-By: Guy Harris <[email protected]>
pcap-netfilter-linux.c

index 225e49f904e25f5fe193b1f90bfdadd67ec26755..f9c6beff6e820bf59d609fc36eae63a8bf270084 100644 (file)
@@ -452,8 +452,8 @@ netfilter_platform_finddevs(pcap_if_t **alldevsp, char *err_str)
        
        sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
        if (sock < 0) {
-               /* if netlink is not supported this this is not fatal */
-               if (errno == EAFNOSUPPORT)
+               /* if netlink is not supported this is not fatal */
+               if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT)
                        return 0;
                snprintf(err_str, PCAP_ERRBUF_SIZE, "Can't open netlink socket %d:%s",
                        errno, pcap_strerror(errno));