summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2014-05-15 09:05:13 +0000
committermpi <mpi@openbsd.org>2014-05-15 09:05:13 +0000
commitd9418352e5c884ea79c1eecbf8c113336aa3d416 (patch)
tree532a7df70cda3e2b6bc018872f2be8b76f08302d
parentUse log_warn() to include errno if write() fails. (diff)
downloadwireguard-openbsd-d9418352e5c884ea79c1eecbf8c113336aa3d416.tar.xz
wireguard-openbsd-d9418352e5c884ea79c1eecbf8c113336aa3d416.zip
Do not use nd6_rtrequest() for addresses configured on loopback
interfaces. ok mikeb@
-rw-r--r--sys/netinet6/in6.c4
-rw-r--r--sys/netinet6/nd6.c22
2 files changed, 10 insertions, 16 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 300abd63c3c..200265196d3 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.c,v 1.136 2014/05/05 11:44:33 mpi Exp $ */
+/* $OpenBSD: in6.c,v 1.137 2014/05/15 09:05:13 mpi Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
@@ -1399,7 +1399,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia6, int newhost)
/* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */
if (newhost) {
/* set the rtrequest function to create llinfo */
- if ((ifp->if_flags & IFF_POINTOPOINT) == 0)
+ if ((ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) == 0)
ia6->ia_ifa.ifa_rtrequest = nd6_rtrequest;
rt_ifa_addloop(&(ia6->ia_ifa));
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 4365d95d784..450e83b1c0e 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.116 2014/05/07 08:14:59 mpi Exp $ */
+/* $OpenBSD: nd6.c,v 1.117 2014/05/15 09:05:13 mpi Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -1059,20 +1059,14 @@ nd6_rtrequest(int req, struct rtentry *rt)
#endif
/* FALLTHROUGH */
case RTM_RESOLVE:
- if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) {
- /*
- * Address resolution isn't necessary for a point to
- * point link, so we can skip this test for a p2p link.
- */
- if (gate->sa_family != AF_LINK ||
- gate->sa_len < sizeof(null_sdl)) {
- log(LOG_DEBUG, "%s: bad gateway value: %s\n",
- __func__, ifp->if_xname);
- break;
- }
- SDL(gate)->sdl_type = ifp->if_type;
- SDL(gate)->sdl_index = ifp->if_index;
+ if (gate->sa_family != AF_LINK ||
+ gate->sa_len < sizeof(null_sdl)) {
+ log(LOG_DEBUG, "%s: bad gateway value: %s\n",
+ __func__, ifp->if_xname);
+ break;
}
+ SDL(gate)->sdl_type = ifp->if_type;
+ SDL(gate)->sdl_index = ifp->if_index;
if (ln != NULL)
break; /* This happens on a route change */
/*