diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2012-02-29 01:19:18 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-02-29 01:20:35 -0800 |
commit | 44538b67fdadcae3da1bc6363eb85ac2d8b4623c (patch) | |
tree | 11283dd569428bf6dcbad3b8a7d4eee767f3df9b | |
parent | 8b9b3d4f8d6b9160050cad7bd6bff0345a3436fd (diff) | |
download | libpcap-44538b67fdadcae3da1bc6363eb85ac2d8b4623c.tar.gz |
Don't fail if netfilter isn't enabled in the kernel.
Check for EPROTONOSUPPORT as well as EAFNOSUPPORT.
Reviewed-By: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | pcap-netfilter-linux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap-netfilter-linux.c b/pcap-netfilter-linux.c index 225e49f9..f9c6beff 100644 --- a/pcap-netfilter-linux.c +++ b/pcap-netfilter-linux.c @@ -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)); |