On 13/09/15(Sun) 12:55, Heiko Zimmermann wrote: > Hello Team, > > with today's snapshot (tested i386 and amd64) is access to hostname.re0 > IPs broken. Also can't ping. > > 127.0.0.1 is ok. > > With cvs -d anon...@anoncvs.ca.openbsd.org:/cvs -q up -D "2 days ago" > all works fine. > > Best Regards, > Heiko > > > # ping 176.9.157.76 > PING 176.9.157.76 (176.9.157.76): 56 data bytes > --- 176.9.157.76 ping statistics --- > 9 packets transmitted, 0 packets received, 100.0% packet loss
Thanks for the report and the provided informations. The problem is due to a mismatch of interface in pf_test() between input and output for local traffic. Diff below corrects that, ok? Index: netinet/ip_output.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_output.c,v retrieving revision 1.296 diff -u -p -r1.296 ip_output.c --- netinet/ip_output.c 12 Sep 2015 20:26:07 -0000 1.296 +++ netinet/ip_output.c 13 Sep 2015 13:33:54 -0000 @@ -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++; Index: netinet6/ip6_output.c =================================================================== RCS file: /cvs/src/sys/netinet6/ip6_output.c,v retrieving revision 1.187 diff -u -p -r1.187 ip6_output.c --- netinet6/ip6_output.c 12 Sep 2015 20:26:07 -0000 1.187 +++ netinet6/ip6_output.c 13 Sep 2015 13:34:11 -0000 @@ -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; }