diff options
author | 2015-09-13 13:57:07 +0000 | |
---|---|---|
committer | 2015-09-13 13:57:07 +0000 | |
commit | 9e948f0929f2fd8ff24b7b6bcde444331ca72761 (patch) | |
tree | 57bab912627cce59db54f986ce43944ac3e99bea /sys/netinet6 | |
parent | Wrap long lines. (diff) | |
download | wireguard-openbsd-9e948f0929f2fd8ff24b7b6bcde444331ca72761.tar.xz wireguard-openbsd-9e948f0929f2fd8ff24b7b6bcde444331ca72761.zip |
Get the default loopback interface pointer just after doing a route
lookup to ensure pf_test() is called with the same interface in the
input annd output path for local traffic.
Fix a regression reported by Heiko Zimmermann on bugs@, thanks!
ok mikeb@, claudio@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ip6_output.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 076cd409dbd..d4d8348d77b 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.187 2015/09/12 20:26:07 mpi Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.188 2015/09/13 13:57:07 mpi Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -550,7 +550,10 @@ reroute: error = EHOSTUNREACH; goto bad; } - ifp = if_ref(rt->rt_ifp); + if (ISSET(rt->rt_flags, RTF_LOCAL)) + ifp = if_ref(lo0ifp); + else + ifp = if_ref(rt->rt_ifp); } else { *dst = dstsock; } |