From 5233a64e0be0465c1a60e1b8a9e3752281e96549 Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 19 Aug 2014 12:39:36 +0000 Subject: [PATCH] Entries for broadcast addresses should also be ignored, just like local entries. ok florian@, mikeb@, henning@ --- sbin/route/route.c | 4 ++-- usr.sbin/arp/arp.c | 4 ++-- usr.sbin/ndp/ndp.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/route/route.c b/sbin/route/route.c index d85ce7ae799..4c1bdfbb3c7 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.169 2014/07/24 17:45:35 jca Exp $ */ +/* $OpenBSD: route.c,v 1.170 2014/08/19 12:39:36 mpi Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -320,7 +320,7 @@ flushroutes(int argc, char **argv) print_rtmsg(rtm, rtm->rtm_msglen); if ((rtm->rtm_flags & (RTF_GATEWAY|RTF_STATIC|RTF_LLINFO)) == 0) continue; - if ((rtm->rtm_flags & RTF_LOCAL) != 0) + if ((rtm->rtm_flags & (RTF_LOCAL|RTF_BROADCAST)) != 0) continue; sa = (struct sockaddr *)(next + rtm->rtm_hdrlen); if (af && sa->sa_family != af) diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index d18f56a600f..19a6d13519f 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arp.c,v 1.57 2014/08/11 09:47:56 mpi Exp $ */ +/* $OpenBSD: arp.c,v 1.58 2014/08/19 12:39:36 mpi Exp $ */ /* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */ /* @@ -408,7 +408,7 @@ tryagain: sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin_len) + (char *)sin); if (sin->sin_addr.s_addr == sin_m.sin_addr.s_addr) { if (sdl->sdl_family == AF_LINK && rtm->rtm_flags & RTF_LLINFO) { - if (rtm->rtm_flags & RTF_LOCAL) + if (rtm->rtm_flags & (RTF_LOCAL|RTF_BROADCAST)) return (0); if (!(rtm->rtm_flags & RTF_GATEWAY)) switch (sdl->sdl_type) { diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 1b78be15c62..ee310f3b47f 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndp.c,v 1.54 2014/08/11 09:47:56 mpi Exp $ */ +/* $OpenBSD: ndp.c,v 1.55 2014/08/19 12:39:36 mpi Exp $ */ /* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */ /* @@ -507,7 +507,7 @@ delete(char *host) sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin); if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) { if (sdl->sdl_family == AF_LINK && rtm->rtm_flags & RTF_LLINFO) { - if (rtm->rtm_flags & RTF_LOCAL) + if (rtm->rtm_flags & (RTF_LOCAL|RTF_BROADCAST)) return (0); if (!(rtm->rtm_flags & RTF_GATEWAY)) goto delete; -- 2.20.1