diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-09-12 20:26:08 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-09-12 20:26:08 +0000 |
commit | 62488894e357cef741a48eeff848f58431ce07ed (patch) | |
tree | f70491c5141d8697d0b27819c26bbca957b26bf1 /sys/netinet6 | |
parent | d4533dcdd79582de2b7d8682334227be2c589776 (diff) |
Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.
Use instead the RTF_LOCAL flag to loop local traffic back to the
corresponding protocol queue.
With this change rt_ifp is now always the same as rt_ifa->ifa_ifp.
ok claudio@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 3 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 6 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 11 |
3 files changed, 5 insertions, 15 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index c0a30cdbc75..f3ace76f084 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1581,8 +1581,7 @@ phyint_send6(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m) * We just call if_output instead of nd6_output here, since * we need no ND for a multicast forwarded packet...right? */ - error = (*ifp->if_output)(ifp, mb_copy, - sin6tosa(&ro.ro_dst), NULL); + error = if_output(ifp, mb_copy, sin6tosa(&ro.ro_dst), NULL); #ifdef MRT6DEBUG if (mrt6debug & DEBUG_XMIT) log(LOG_DEBUG, "phyint_send6 on mif %d err %d\n", diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index af8ba3d0e10..076cd409dbd 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.186 2015/09/12 13:34:12 mpi Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.187 2015/09/12 20:26:07 mpi Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -3028,9 +3028,7 @@ ip6_setpktopt(int optname, u_char *buf, int len, struct ip6_pktopts *opt, /* * Routine called from ip6_output() to loop back a copy of an IP6 multicast - * packet to the input queue of a specified interface. Note that this - * calls the output routine of the loopback "driver", but with an interface - * pointer that might NOT be lo0ifp -- easier than replicating that code here. + * packet to the input queue of a specified interface. */ void ip6_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in6 *dst) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index ba57ab46438..b37a5cc09df 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.150 2015/09/10 17:52:05 claudio Exp $ */ +/* $OpenBSD: nd6.c,v 1.151 2015/09/12 20:26:07 mpi Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -1113,13 +1113,6 @@ nd6_rtrequest(int req, struct rtentry *rt) ln->ln_byhint = 0; /* - * XXX Since lo0 is in the default rdomain we - * should not (ab)use it for any route related - * to an interface of a different rdomain. - */ - rt->rt_ifp = lo0ifp; - - /* * Make sure rt_ifa be equal to the ifaddr * corresponding to the address. * We need this because when we refer @@ -1699,7 +1692,7 @@ nd6_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr_in6 *dst, return (0); sendpkt: - return ((*ifp->if_output)(ifp, m, sin6tosa(dst), rt)); + return (if_output(ifp, m, sin6tosa(dst), rt)); bad: m_freem(m); |