summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2008-09-14 08:19:48 +0000
committerjulian <julian@FreeBSD.org>2008-09-14 08:19:48 +0000
commit4d475b063c3db123002a792569518ef9d8e5a2ef (patch)
tree2c18e8a3db95e093c313dc15286cfe2f1d8ca059 /sys/netinet
parent7238ec0b33915c236ffd27e412b0a4f7a92071d5 (diff)
downloadFreeBSD-src-4d475b063c3db123002a792569518ef9d8e5a2ef.zip
FreeBSD-src-4d475b063c3db123002a792569518ef9d8e5a2ef.tar.gz
Revert a part of the MRT commit that proved un-needed.
rt_check() in its original form proved to be sufficient and rt_check_fib() can go away (as can its evil twin in_rt_check()). I believe this does NOT address the crashes people have been seeing in rt_check. MFC after: 1 week
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c21
-rw-r--r--sys/netinet/in_rmx.c7
-rw-r--r--sys/netinet/in_var.h1
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);
OpenPOWER on IntegriCloud