summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2014-06-16 19:47:21 +0000
committermpi <mpi@openbsd.org>2014-06-16 19:47:21 +0000
commitaad532fb2eab677e35db7c839625abd17f68f977 (patch)
tree5f1ca40c91dcc67041c54d8ab2fdb4fecdb9460b
parentAllow autoinstall to fetch/install sets from multiple locations. (diff)
downloadwireguard-openbsd-aad532fb2eab677e35db7c839625abd17f68f977.tar.xz
wireguard-openbsd-aad532fb2eab677e35db7c839625abd17f68f977.zip
Revert "Always create a local route for every configured IPv4 address",
it introduces a regression with default routes & p2p interfaces. Problem reported by naddy@
-rw-r--r--sys/net/route.c8
-rw-r--r--sys/netinet/if_ether.c8
-rw-r--r--sys/netinet/in.c5
3 files changed, 7 insertions, 14 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index e8304944565..7601cb56900 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -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);
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index a4a6d67c100..0edf1a9c6de 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -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)
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index bbf7db66c70..74403a8adfc 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -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) {