On Fri, May 06, 2016 at 02:27:46PM +0200, Martin Pieuchot wrote:
> Now that ip_forward() is reusing the route fetched by in_ouraddr() we
> want to make sure we're fetching a possible RTF_MPATH route and not
> simply picking the first one every time.
>
> This restore the behavior of r1.274 when using mpath entries for
> forwarding, ok?
Could this break in_ouraddr in a case where the local address is on a
interface which is not UP? My worry is that the MPATH selection will no
longer pick the first route and that we kind of expected that behaviour.
IIRC it should not be possible since the local addrs are hardcoded to prio
1 but just wanted to double check.
If you come to the same conclusion then OK claudio@
> Index: netinet/ip_input.c
> ===================================================================
> RCS file: /cvs/src/sys/netinet/ip_input.c,v
> retrieving revision 1.275
> diff -u -p -r1.275 ip_input.c
> --- netinet/ip_input.c 3 May 2016 12:19:13 -0000 1.275
> +++ netinet/ip_input.c 6 May 2016 12:22:57 -0000
> @@ -606,7 +606,8 @@ in_ouraddr(struct mbuf *m, struct ifnet
> sin.sin_len = sizeof(sin);
> sin.sin_family = AF_INET;
> sin.sin_addr = ip->ip_dst;
> - rt = rtalloc(sintosa(&sin), 0, m->m_pkthdr.ph_rtableid);
> + rt = rtalloc_mpath(sintosa(&sin), &ip->ip_src.s_addr,
> + m->m_pkthdr.ph_rtableid);
> if (rtisvalid(rt)) {
> if (ISSET(rt->rt_flags, RTF_LOCAL))
> match = 1;
>
--
:wq Claudio