summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-07-03 17:01:13 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-07-03 17:01:13 +0200
commitc2dd1b3f2f459b90ed16600bcd5aa0369610e80e (patch)
tree537c0d9997698dc6c5704993828467a3f8913cb1
parentf5c10ae4e3cc56eb0a8662c39442146415cc2df4 (diff)
pcap: fix build error
Various fixes for last commit. Sorry for that. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r--built_in.h8
-rw-r--r--pcap_io.h8
2 files changed, 12 insertions, 4 deletions
diff --git a/built_in.h b/built_in.h
index 1cca2d7..a431597 100644
--- a/built_in.h
+++ b/built_in.h
@@ -364,4 +364,12 @@ static inline u64 cpu_to_le64(u64 val)
# define POLLRDHUP 0x2000
#endif
+#ifndef ARPHRD_IP6GRE
+# define ARPHRD_IP6GRE 823
+#endif
+
+#ifndef ARPHRD_NETLINK
+# define ARPHRD_NETLINK 824
+#endif
+
#endif /* BUILT_IN_H */
diff --git a/pcap_io.h b/pcap_io.h
index 18ce8ea..b61e042 100644
--- a/pcap_io.h
+++ b/pcap_io.h
@@ -13,7 +13,10 @@
#include <stdbool.h>
#include <errno.h>
#include <sys/time.h>
+#include <sys/socket.h>
+#include <linux/if.h>
#include <linux/if_packet.h>
+#include <linux/if_arp.h>
#include "built_in.h"
#include "die.h"
@@ -171,9 +174,7 @@ static inline uint16_t tp_to_pcap_tsource(uint32_t status)
static inline int pcap_devtype_to_linktype(const char *ifname)
{
- int type = device_type(ifname);
-
- case (type) {
+ switch (device_type(ifname)) {
case ARPHRD_TUNNEL:
case ARPHRD_TUNNEL6:
case ARPHRD_LOOPBACK:
@@ -203,7 +204,6 @@ static inline int pcap_devtype_to_linktype(const char *ifname)
case ARPHRD_PPP: return LINKTYPE_PPP;
case ARPHRD_CAN: return LINKTYPE_CAN20B;
case ARPHRD_ECONET: return LINKTYPE_ECONET;
- case ARPHRD_HDLC:
case ARPHRD_RAWHDLC:
case ARPHRD_CISCO: return LINKTYPE_C_HDLC;
case ARPHRD_FDDI: return LINKTYPE_FDDI;