diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2003-09-23 09:19:19 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2003-09-23 09:19:19 +0000 |
commit | 943bf34f6bdc36f6c29e76bcd6bfcaf7ff938a9c (patch) | |
tree | 9b34b8dba5b49499c40745be6fa3c87969c1e291 /usr.sbin/mtrace | |
parent | fa5ac32cbd68bc040f3e6787e9958e5d885f23aa (diff) |
ignore address families other than AF_INET in get_netmask().
ok cedric@
Diffstat (limited to 'usr.sbin/mtrace')
-rw-r--r-- | usr.sbin/mtrace/mtrace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c index 078de372ae1..f5f0dbfc6ed 100644 --- a/usr.sbin/mtrace/mtrace.c +++ b/usr.sbin/mtrace/mtrace.c @@ -52,7 +52,7 @@ #ifndef lint static char rcsid[] = - "@(#) $Id: mtrace.c,v 1.19 2003/08/19 22:19:07 itojun Exp $"; + "@(#) $Id: mtrace.c,v 1.20 2003/09/23 09:19:18 matthieu Exp $"; #endif #include <netdb.h> @@ -295,6 +295,8 @@ get_netmask(s, dst) return (retval); } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + if (ifa->ifa_addr->sa_family != AF_INET) + continue; if_addr = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr; if_mask = ((struct sockaddr_in *)ifa->ifa_netmask)->sin_addr.s_addr; if ((dst & if_mask) == (if_addr & if_mask)) { |