diff options
author | 2015-09-13 13:57:07 +0000 | |
---|---|---|
committer | 2015-09-13 13:57:07 +0000 | |
commit | 9e948f0929f2fd8ff24b7b6bcde444331ca72761 (patch) | |
tree | 57bab912627cce59db54f986ce43944ac3e99bea /sys/netinet/ip_output.c | |
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/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 805c3776eb6..5ca69d5a69e 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.296 2015/09/12 20:26:07 mpi Exp $ */ +/* $OpenBSD: ip_output.c,v 1.297 2015/09/13 13:57:07 mpi Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -201,7 +201,10 @@ reroute: } ia = ifatoia(ro->ro_rt->rt_ifa); - ifp = if_ref(ro->ro_rt->rt_ifp); + if (ISSET(ro->ro_rt->rt_flags, RTF_LOCAL)) + ifp = if_ref(lo0ifp); + else + ifp = if_ref(ro->ro_rt->rt_ifp); if ((mtu = ro->ro_rt->rt_rmx.rmx_mtu) == 0) mtu = ifp->if_mtu; ro->ro_rt->rt_use++; |