dect
/
libpcap
Archived
13
0
Fork 0

From Shaun Clowes: work around brokenness in the 32-bit compatibility

layer for Linux on IA-64.
This commit is contained in:
guy 2004-02-27 08:03:05 +00:00
parent 673ea44790
commit f61f1bb9a6
1 changed files with 15 additions and 1 deletions

View File

@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/libpcap/fad-gifc.c,v 1.5 2003-11-15 23:23:58 guy Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/fad-gifc.c,v 1.6 2004-02-27 08:03:05 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -323,6 +323,20 @@ pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
else
ifnext = (struct ifreq *)((char *)ifrp + n);
/*
* XXX - The 32-bit compatibility layer for Linux on IA-64
* is slightly broken. It correctly converts the structures
* to and from kernel land from 64 bit to 32 bit but
* doesn't update ifc.ifc_len, leaving it larger than the
* amount really used. This means we read off the end
* of the buffer and encounter an interface with an
* "empty" name. Since this is highly unlikely to ever
* occur in a valid case we can just finish looking for
* interfaces if we see an empty name.
*/
if (!(*ifrp->ifr_name))
break;
/*
* Get the flags for this interface, and skip it if it's
* not up.