Entries for broadcast addresses should also be ignored, just like local
authormpi <mpi@openbsd.org>
Tue, 19 Aug 2014 12:39:36 +0000 (12:39 +0000)
committermpi <mpi@openbsd.org>
Tue, 19 Aug 2014 12:39:36 +0000 (12:39 +0000)
entries.

ok florian@, mikeb@, henning@

sbin/route/route.c
usr.sbin/arp/arp.c
usr.sbin/ndp/ndp.c

index d85ce7a..4c1bdfb 100644 (file)
@@ -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)
index d18f56a..19a6d13 100644 (file)
@@ -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) {
index 1b78be1..ee310f3 100644 (file)
@@ -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;