summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_src.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-07-05 09:17:11 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-07-05 09:17:11 +0000
commit16c1e0176101f4ef86917f0014fcbb19b6b12b78 (patch)
tree798a16165c01e722d6454d99150f3087d9809da3 /sys/netinet6/in6_src.c
parent07b41d724d43b24bf5c323d12c2cdb3d898d9eef (diff)
Do not use ``rt_addr'' in in{6,}_selectsrc() it doesn't work with magic
addresses set on p2p interfaces. Found the hardway by naddy@
Diffstat (limited to 'sys/netinet6/in6_src.c')
-rw-r--r--sys/netinet6/in6_src.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index b26e0e645d2..6cecd702199 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_src.c,v 1.74 2016/06/30 12:36:27 mpi Exp $ */
+/* $OpenBSD: in6_src.c,v 1.75 2016/07/05 09:17:10 mpi Exp $ */
/* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */
/*
@@ -257,11 +257,8 @@ in6_selectsrc(struct in6_addr **in6src, struct sockaddr_in6 *dstsock,
ia6 = in6_ifawithscope(ifp, dst, rtableid);
if_put(ifp);
}
- if (ia6 == NULL) { /* xxx scope error ?*/
- *in6src =
- &satosin6(ro->ro_rt->rt_addr)->sin6_addr;
- return (0);
- }
+ if (ia6 == NULL) /* xxx scope error ?*/
+ ia6 = ifatoia6(ro->ro_rt->rt_ifa);
}
if (ia6 == NULL)
return (EHOSTUNREACH); /* no route */