Revert "Always create a local route for every configured IPv4 address",
authormpi <mpi@openbsd.org>
Mon, 16 Jun 2014 19:47:21 +0000 (19:47 +0000)
committermpi <mpi@openbsd.org>
Mon, 16 Jun 2014 19:47:21 +0000 (19:47 +0000)
it introduces a regression with default routes & p2p interfaces.

Problem reported by naddy@

sys/net/route.c
sys/netinet/if_ether.c
sys/netinet/in.c

index e830494..7601cb5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: route.c,v 1.170 2014/06/11 11:30:03 mpi Exp $ */
+/*     $OpenBSD: route.c,v 1.171 2014/06/16 19:47:21 mpi Exp $ */
 /*     $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $      */
 
 /*
@@ -1129,8 +1129,7 @@ rt_ifa_add(struct ifaddr *ifa, int flags, struct sockaddr *dst)
                        if (ifa->ifa_rtrequest)
                                ifa->ifa_rtrequest(RTM_ADD, rt);
                }
-               if (flags & RTF_LOCAL)
-                       rt_newaddrmsg(RTM_ADD, ifa, error, nrt);
+               rt_newaddrmsg(RTM_ADD, ifa, error, nrt);
        }
        return (error);
 }
@@ -1184,8 +1183,7 @@ rt_ifa_del(struct ifaddr *ifa, int flags, struct sockaddr *dst)
 
        error = rtrequest1(RTM_DELETE, &info, prio, &nrt, rtableid);
        if (error == 0 && (rt = nrt) != NULL) {
-               if (flags & RTF_LOCAL)
-                       rt_newaddrmsg(RTM_DELETE, ifa, error, nrt);
+               rt_newaddrmsg(RTM_DELETE, ifa, error, nrt);
                if (rt->rt_refcnt <= 0) {
                        rt->rt_refcnt++;
                        rtfree(rt);
index a4a6d67..0edf1a9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_ether.c,v 1.128 2014/06/11 11:30:03 mpi Exp $      */
+/*     $OpenBSD: if_ether.c,v 1.129 2014/06/16 19:47:21 mpi Exp $      */
 /*     $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $    */
 
 /*
@@ -174,8 +174,7 @@ arp_rtrequest(int req, struct rtentry *rt)
                if ((rt->rt_flags & RTF_HOST) == 0 && rt_mask(rt) &&
                    satosin(rt_mask(rt))->sin_addr.s_addr != 0xffffffff)
                        rt->rt_flags |= RTF_CLONING;
-               if (rt->rt_flags & RTF_CLONING ||
-                   ((rt->rt_flags & RTF_LLINFO) && !la)) {
+               if (rt->rt_flags & RTF_CLONING) {
                        /*
                         * Case 1: This route should come from a route to iface.
                         */
@@ -190,8 +189,7 @@ arp_rtrequest(int req, struct rtentry *rt)
                         * from it do not need their expiration time set.
                         */
                        rt->rt_expire = time_second;
-                       if ((rt->rt_flags & RTF_CLONING) != 0)
-                               break;
+                       break;
                }
                /* Announce a new entry if requested. */
                if (rt->rt_flags & RTF_ANNOUNCE)
index bbf7db6..74403a8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: in.c,v 1.97 2014/06/11 11:30:03 mpi Exp $     */
+/*     $OpenBSD: in.c,v 1.98 2014/06/16 19:47:21 mpi Exp $     */
 /*     $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
 
 /*
@@ -702,7 +702,6 @@ out:
         * carp(4).
         */
        ifa_add(ifp, &ia->ia_ifa);
-       rt_ifa_addloop(&ia->ia_ifa);
 
        if (error && newaddr)
                in_purgeaddr(&ia->ia_ifa);
@@ -720,8 +719,6 @@ in_purgeaddr(struct ifaddr *ifa)
 
        in_ifscrub(ifp, ia);
 
-       rt_ifa_delloop(&ia->ia_ifa);
-
        ifa_del(ifp, &ia->ia_ifa);
        TAILQ_REMOVE(&in_ifaddr, ia, ia_list);
        if (ia->ia_allhosts != NULL) {