]> The Tcpdump Group git mirrors - libpcap/commitdiff
It appears that, at least with the 2.6.27.5 kernel (and maybe the 2.6.27
authorguy <guy>
Sun, 14 Dec 2008 20:30:29 +0000 (20:30 +0000)
committerguy <guy>
Sun, 14 Dec 2008 20:30:29 +0000 (20:30 +0000)
kernel in general), <linux/wireless.h> includes <net/if.h> and you get
multiple-definition errors if you include <net/if.h> before it.  Only
include <net/if.h> if you don't have <linux/wireless.h>.

pcap-linux.c

index 0da4297349246704ea79548a70d621138458ed68..be60001ecfa8205bc35458511684d002f238247d 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.129.2.33 2008-12-14 20:05:26 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.129.2.34 2008-12-14 20:30:29 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -93,19 +93,21 @@ static const char rcsid[] _U_ =
 #include <sys/ioctl.h>
 #include <sys/utsname.h>
 #include <sys/mman.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <linux/if_ether.h>
-#include <net/if_arp.h>
-#include <poll.h>
 
 /*
  * Got Wireless Extensions?
  */
 #ifdef HAVE_LINUX_WIRELESS_H
 #include <linux/wireless.h>
+#else
+#include <net/if.h>
 #endif
 
+#include <netinet/in.h>
+#include <linux/if_ether.h>
+#include <net/if_arp.h>
+#include <poll.h>
+
 #include "pcap-int.h"
 #include "pcap/sll.h"
 #include "pcap/vlan.h"