File libpcap-1.2.1-netfilter-dont-fail-on-EPROTONOSUPPORT.patch of Package libpcap
From 5fad270aaa970512fc2aaf8f2ea361b247bb7477 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jirislaby@gmail.com>
Date: Tue, 28 Feb 2012 14:36:43 +0100
Subject: [PATCH] netfilter: don't fail on EPROTONOSUPPORT
EPROTONOSUPPORT is what I get from the kernel if I don't have netfilter enabled.
This bug prevents tcpdump/wireshark to work properly:
tcpdump: Can't open netlink socket 93:Protocol not supported
---
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 225e49f..86235d1 100644
--- a/pcap-netfilter-linux.c
+++ b/pcap-netfilter-linux.c
@@ -452,8 +452,8 @@ struct my_nfattr {
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));
--
1.7.5.4