diff -U 4 -r libpcap-2004.02.22/fad-gifc.c libpcap/fad-gifc.c --- libpcap-2004.02.22/fad-gifc.c Sun Nov 16 10:23:58 2003 +++ libpcap/fad-gifc.c Mon Feb 23 11:07:34 2004 @@ -323,8 +323,22 @@ else ifnext = (struct ifreq *)((char *)ifrp + n); /* + * XXX - The 32 bit compatibility layer for Linux on IA64 + * 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 looing for + * interfaces then + */ + if (!(*ifrp->ifr_name)) + break; + + /* * Get the flags for this interface, and skip it if it's * not up. */ strncpy(ifrflags.ifr_name, ifrp->ifr_name,