Lines 108-114
__FBSDID("$FreeBSD$");
Link Here
|
108 |
#include <machine/in_cksum.h> |
108 |
#include <machine/in_cksum.h> |
109 |
|
109 |
|
110 |
static struct sockaddr_in * |
110 |
static struct sockaddr_in * |
111 |
ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) |
111 |
ip_findroute(struct route *ro, struct ip *ip, struct in_addr dest, |
|
|
112 |
struct mbuf *m) |
112 |
{ |
113 |
{ |
113 |
struct sockaddr_in *dst; |
114 |
struct sockaddr_in *dst; |
114 |
struct rtentry *rt; |
115 |
struct rtentry *rt; |
Lines 121-127
ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m)
Link Here
|
121 |
dst->sin_family = AF_INET; |
122 |
dst->sin_family = AF_INET; |
122 |
dst->sin_len = sizeof(*dst); |
123 |
dst->sin_len = sizeof(*dst); |
123 |
dst->sin_addr.s_addr = dest.s_addr; |
124 |
dst->sin_addr.s_addr = dest.s_addr; |
124 |
in_rtalloc_ign(ro, 0, M_GETFIB(m)); |
125 |
#ifdef RADIX_MPATH |
|
|
126 |
rtalloc_mpath_fib(&ro, |
127 |
ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr), |
128 |
M_GETFIB(m)); |
129 |
#else |
130 |
in_rtalloc_ign(&ro, 0, M_GETFIB(m)); |
131 |
#endif |
132 |
|
125 |
|
133 |
|
126 |
/* |
134 |
/* |
127 |
* Route there and interface still up? |
135 |
* Route there and interface still up? |
Lines 305-311
passin:
Link Here
|
305 |
/* |
313 |
/* |
306 |
* Find route to destination. |
314 |
* Find route to destination. |
307 |
*/ |
315 |
*/ |
308 |
if ((dst = ip_findroute(&ro, dest, m)) == NULL) |
316 |
if ((dst = ip_findroute(&ro, ip, dest, m)) == NULL) |
309 |
return NULL; /* icmp unreach already sent */ |
317 |
return NULL; /* icmp unreach already sent */ |
310 |
ifp = ro.ro_rt->rt_ifp; |
318 |
ifp = ro.ro_rt->rt_ifp; |
311 |
|
319 |
|
Lines 366-372
forwardlocal:
Link Here
|
366 |
m->m_flags &= ~M_IP_NEXTHOP; |
374 |
m->m_flags &= ~M_IP_NEXTHOP; |
367 |
} |
375 |
} |
368 |
RTFREE(ro.ro_rt); |
376 |
RTFREE(ro.ro_rt); |
369 |
if ((dst = ip_findroute(&ro, dest, m)) == NULL) |
377 |
if ((dst = ip_findroute(&ro, ip, dest, m)) == NULL) |
370 |
return NULL; /* icmp unreach already sent */ |
378 |
return NULL; /* icmp unreach already sent */ |
371 |
ifp = ro.ro_rt->rt_ifp; |
379 |
ifp = ro.ro_rt->rt_ifp; |
372 |
} |
380 |
} |