Get rid of a no-longer-necessary #include (we no longer check
no_optimize - we check, instead, whether the kernel rejected the program). Move the initialization of the bpf_dltlist structure right before its first use.
This commit is contained in:
parent
f6b660f997
commit
cb5be6a88e
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] _U_ =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.99.2.2 2008-01-02 04:22:16 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.99.2.3 2008-01-29 10:01:07 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -102,8 +102,6 @@ static int odmlockid = 0;
|
|||
#include "os-proto.h"
|
||||
#endif
|
||||
|
||||
#include "gencode.h" /* for "no_optimize" */
|
||||
|
||||
static int pcap_setfilter_bpf(pcap_t *p, struct bpf_program *fp);
|
||||
static int pcap_setdirection_bpf(pcap_t *, pcap_direction_t);
|
||||
static int pcap_set_datalink_bpf(pcap_t *p, int dlt);
|
||||
|
@ -613,10 +611,6 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
|
|||
}
|
||||
#endif /* HAVE_DAG_API */
|
||||
|
||||
#ifdef BIOCGDLTLIST
|
||||
memset(&bdl, 0, sizeof(bdl));
|
||||
#endif
|
||||
|
||||
p = (pcap_t *)malloc(sizeof(*p));
|
||||
if (p == NULL) {
|
||||
snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
|
||||
|
@ -752,6 +746,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
|
|||
* this interface supports. If this fails with EINVAL, it's
|
||||
* not fatal; we just don't get to use the feature later.
|
||||
*/
|
||||
memset(&bdl, 0, sizeof(bdl));
|
||||
if (ioctl(fd, BIOCGDLTLIST, (caddr_t)&bdl) == 0) {
|
||||
u_int i;
|
||||
int is_ethernet;
|
||||
|
|
Reference in New Issue