diff options
author | fenner <fenner@FreeBSD.org> | 1998-09-15 19:28:10 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 1998-09-15 19:28:10 +0000 |
commit | ca0d84cb8bfc8789fd48ada56322a575c4a1aa68 (patch) | |
tree | 5c946e9b84405911032e77b9942372a03521a64f /contrib/libpcap/inet.c | |
parent | 737558aa98d3b86de65ff8e1fd0fe39d5debcde7 (diff) | |
download | FreeBSD-src-ca0d84cb8bfc8789fd48ada56322a575c4a1aa68.zip FreeBSD-src-ca0d84cb8bfc8789fd48ada56322a575c4a1aa68.tar.gz |
Virgin import of LBL libpcap v0.4
Diffstat (limited to 'contrib/libpcap/inet.c')
-rw-r--r-- | contrib/libpcap/inet.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/libpcap/inet.c b/contrib/libpcap/inet.c index 1645d80..ffcb347 100644 --- a/contrib/libpcap/inet.c +++ b/contrib/libpcap/inet.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 1995, 1996 + * Copyright (c) 1994, 1995, 1996, 1997, 1998 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: inet.c,v 1.20 96/10/19 14:58:47 leres Exp $ (LBL)"; + "@(#) $Header: inet.c,v 1.22 98/01/30 17:29:34 leres Exp $ (LBL)"; #endif #include <sys/param.h> @@ -72,7 +72,8 @@ struct rtentry; #ifdef IFF_LOOPBACK #define ISLOOPBACK(p) ((p)->ifr_flags & IFF_LOOPBACK) #else -#define ISLOOPBACK(p) (strcmp((p)->ifr_name, "lo0") == 0) +#define ISLOOPBACK(p) ((p)->ifr_name[0] == 'l' && (p)->ifr_name[1] == 'o' && \ + (isdigit((p)->ifr_name[2]) || (p)->ifr_name[2] == '\0')) #endif /* @@ -99,6 +100,7 @@ pcap_lookupdev(errbuf) ifc.ifc_len = sizeof ibuf; ifc.ifc_buf = (caddr_t)ibuf; + memset((char *)ibuf, 0, sizeof(ibuf)); if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 || ifc.ifc_len < sizeof(struct ifreq)) { (void)sprintf(errbuf, "SIOCGIFCONF: %s", pcap_strerror(errno)); |