diff options
author | 2015-09-10 14:02:35 +0000 | |
---|---|---|
committer | 2015-09-10 14:02:35 +0000 | |
commit | cfef168a93a495f318bbb202545920db2e16f42e (patch) | |
tree | 796cdc6e3ce14f494a59c3e4909a5aa23dc99402 /sys | |
parent | another missing Mdocdate (diff) | |
download | wireguard-openbsd-cfef168a93a495f318bbb202545920db2e16f42e.tar.xz wireguard-openbsd-cfef168a93a495f318bbb202545920db2e16f42e.zip |
In IPv6 source address selection prefer addresses of the outgoing
interface.
OK mpi@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/in6.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 18efe274793..60cb6ee77c6 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.172 2015/09/10 08:45:32 claudio Exp $ */ +/* $OpenBSD: in6.c,v 1.173 2015/09/10 14:02:35 bluhm Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -1802,6 +1802,12 @@ in6_ifawithscope(struct ifnet *oifp, struct in6_addr *dst, u_int rdomain) IN6_IFF_DEPRECATED) == 0) goto replace; + /* RFC 3484 5. Rule 5: Prefer outgoing interface */ + if (ia6_best->ia_ifp == oifp && ifp != oifp) + continue; + if (ia6_best->ia_ifp != oifp && ifp == oifp) + goto replace; + /* * At this point, we have two cases: * 1. we are looking at a non-deprecated address, |