From c2dd1b3f2f459b90ed16600bcd5aa0369610e80e Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Wed, 3 Jul 2013 17:01:13 +0200 Subject: pcap: fix build error Various fixes for last commit. Sorry for that. Signed-off-by: Daniel Borkmann --- built_in.h | 8 ++++++++ pcap_io.h | 8 ++++---- 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 #include #include +#include +#include #include +#include #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; -- cgit v1.2.3-54-g00ecf