diff options
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 21 | ||||
-rw-r--r-- | sys/netinet/in_rmx.c | 7 | ||||
-rw-r--r-- | sys/netinet/in_var.h | 1 |
3 files changed, 15 insertions, 14 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 3ae3136..5401967 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -364,7 +364,7 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, struct rtentry *rt = NULL; struct sockaddr_dl *sdl; int error; - int fibnum = 0; + int fibnum = -1; if (m) { if (m->m_flags & M_BCAST) { @@ -385,7 +385,7 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, /* Look for a cached arp (ll) entry. */ if (m == NULL) fibnum = rt0->rt_fibnum; - error = in_rt_check(&rt, &rt0, dst, fibnum); + error = rt_check(&rt, &rt0, dst); if (error) { m_freem(m); return error; @@ -394,14 +394,23 @@ arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, if (la == NULL) RT_UNLOCK(rt); } + + /* + * If we had no mbuf and no route, then hope the caller + * has a fib in mind because we are running out of ideas. + * I think this should not happen in current code. + * (kmacy would know). + */ + if (fibnum == -1) + fibnum = curthread->td_proc->p_fibnum; /* last gasp */ + if (la == NULL) { /* * We enter this block if rt0 was NULL, - * or if rt found by in_rt_check() didn't have llinfo. - * We should get a cloned route from the local interface, - * so it should have an ll entry. + * or if rt found by rt_check() didn't have llinfo. + * we should get a cloned route, which since it should + * come from the local interface should have a ll entry. * It may be incomplete but that's ok. - * XXXMRT if we haven't found a fibnum is that OK? */ rt = arplookup(SIN(dst)->sin_addr.s_addr, 1, 0, fibnum); if (rt == NULL) { diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index d8a90d4..e79337b 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -465,13 +465,6 @@ in_rtalloc1(struct sockaddr *dst, int report, u_long ignflags, u_int fibnum) return (rtalloc1_fib(dst, report, ignflags, fibnum)); } -int -in_rt_check(struct rtentry **lrt, struct rtentry **lrt0, - struct sockaddr *dst, u_int fibnum) -{ - return (rt_check_fib(lrt, lrt0, dst, fibnum)); -} - void in_rtredirect(struct sockaddr *dst, struct sockaddr *gateway, diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index 01ff7b3..4999e90 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -314,7 +314,6 @@ void in_rtredirect(struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct sockaddr *, u_int); int in_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); -int in_rt_check(struct rtentry **, struct rtentry **, struct sockaddr *, u_int); #if 0 int in_rt_getifa(struct rt_addrinfo *, u_int fibnum); |