diff options
author | itojun <itojun> | 2000-04-13 04:58:09 +0000 |
---|---|---|
committer | itojun <itojun> | 2000-04-13 04:58:09 +0000 |
commit | 14b709dd48cc512bd2c8f0b8ddb57c2ac1fbfc9e (patch) | |
tree | 63b28a1f76dfdf98fe02a1d3bbe44871e9a3162f | |
parent | 00031c93a7614b0255d41ce8aa30ec22fd6f8818 (diff) |
make loopback interface detection consistent. /^(lo|lo[0-9])$/
-rw-r--r-- | inet.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -33,7 +33,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.28 2000-04-09 20:59:31 assar Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.29 2000-04-13 04:58:09 itojun Exp $ (LBL)"; #endif #include <sys/param.h> @@ -108,8 +108,10 @@ pcap_lookupdev(errbuf) if ((ifa->ifa_flags & IFF_LOOPBACK) != 0) continue; #else - if (strcmp(ifa->ifa_name, "lo0") == 0) + if (strncmp(ifa->ifa_name, "lo", 2) == 0 && + (ifa->ifa_name[2] == '\0' || isdigit(ifa->ifa_name[2]))) { continue; + } #endif for (cp = ifa->ifa_name; !isdigit(*cp); ++cp) |