]> 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:11 +0000 (20:30 +0000)
committerguy <guy>
Sun, 14 Dec 2008 20:30:11 +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 b2dcf926c39ff3b413d9101f611892415db1eb6e..e1145ab9440932f587fe93490d8f4d17746310c4 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.162 2008-12-14 20:03:59 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.163 2008-12-14 20:30:11 guy Exp $ (LBL)";
 #endif
 
 /*
 #endif
 
 /*
@@ -93,19 +93,21 @@ static const char rcsid[] _U_ =
 #include <sys/ioctl.h>
 #include <sys/utsname.h>
 #include <sys/mman.h>
 #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>
 
 /*
  * Got Wireless Extensions?
  */
 #ifdef HAVE_LINUX_WIRELESS_H
 #include <linux/wireless.h>
+#else
+#include <net/if.h>
 #endif
 
 #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"
 #include "pcap-int.h"
 #include "pcap/sll.h"
 #include "pcap/vlan.h"