Skip to content

Commit

Permalink
It appears that, at least with the 2.6.27.5 kernel (and maybe the 2.6.27
Browse files Browse the repository at this point in the history
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>.
  • Loading branch information
yuguy committed Dec 14, 2008
1 parent ad46bc2 commit 080c134
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pcap-linux.c
Expand Up @@ -34,7 +34,7 @@

#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

/*
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 080c134

Please sign in to comment.