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?

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;

Reply via email to