summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2008-03-18 20:03:37 +0000
committerclaudio <claudio@openbsd.org>2008-03-18 20:03:37 +0000
commit15e59362cd4f6ef0aabd098eb211bcd860464f7d (patch)
tree33be37d33ca845461f71f81f6c035327cc639fbb
parentGet rid of some dead wood. (diff)
downloadwireguard-openbsd-15e59362cd4f6ef0aabd098eb211bcd860464f7d.tar.xz
wireguard-openbsd-15e59362cd4f6ef0aabd098eb211bcd860464f7d.zip
Make -I work correctly. RTM_NEWADDR needs to filter the ifname as well.
Found by and tested jmc@
-rw-r--r--usr.bin/netstat/if.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index 5116457262c..29785a2287c 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.56 2008/01/03 21:01:40 claudio Exp $ */
+/* $OpenBSD: if.c,v 1.57 2008/03/18 20:03:37 claudio Exp $ */
/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
/*
@@ -156,6 +156,9 @@ intpr(int interval)
case RTM_NEWADDR:
if (qflag && total == 0)
continue;
+ if (interface != 0 && strcmp(name, interface) != 0)
+ continue;
+
ifam = (struct ifa_msghdr *)next;
if ((ifam->ifam_addrs & (RTA_NETMASK | RTA_IFA |
RTA_BRD)) == 0)