diff options
author | fenner <fenner@FreeBSD.org> | 1996-01-23 05:15:30 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 1996-01-23 05:15:30 +0000 |
commit | ef1b06ef29a9a9c0bb6a584a377bf5f9124a1d25 (patch) | |
tree | e0d4c3fcf8c875d3ee5d3bf3e26572f7c9b5ecde /sys/netinet/in_rmx.c | |
parent | 4332d58d94a2d1f0d1e9a1426d73892031273a1e (diff) | |
download | FreeBSD-src-ef1b06ef29a9a9c0bb6a584a377bf5f9124a1d25.zip FreeBSD-src-ef1b06ef29a9a9c0bb6a584a377bf5f9124a1d25.tar.gz |
First piece of fixing ppp/proxy arp problem:
If an attempt to add a route fails because an "ARP table" entry is in
the way, remove the ARP entry and retry the add.
Reviewed by: nate
Diffstat (limited to 'sys/netinet/in_rmx.c')
-rw-r--r-- | sys/netinet/in_rmx.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index 0d66d3c..958b648 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: in_rmx.c,v 1.21 1995/12/05 17:45:45 wollman Exp $ + * $Id: in_rmx.c,v 1.22 1995/12/19 20:46:13 wollman Exp $ */ /* @@ -82,6 +82,7 @@ in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, { struct rtentry *rt = (struct rtentry *)treenodes; struct sockaddr_in *sin = (struct sockaddr_in *)rt_key(rt); + struct radix_node *ret; /* * For IP, all unicast non-host routes are automatically cloning. @@ -126,7 +127,32 @@ in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; #endif - return rn_addroute(v_arg, n_arg, head, treenodes); + ret = rn_addroute(v_arg, n_arg, head, treenodes); + if (ret == NULL && rt->rt_flags & RTF_HOST) { + struct rtentry *rt2; + /* + * We are trying to add a host route, but can't. + * Find out if it is because of an + * ARP entry and delete it if so. + */ + rt2 = rtalloc1((struct sockaddr *)sin, 0, + RTF_CLONING | RTF_PRCLONING); + if (rt2) { + if (rt2->rt_flags & RTF_LLINFO && + rt2->rt_flags & RTF_HOST && + rt2->rt_gateway && + rt2->rt_gateway->sa_family == AF_LINK) { + rtrequest(RTM_DELETE, + (struct sockaddr *)rt_key(rt2), + rt2->rt_gateway, + rt_mask(rt2), rt2->rt_flags, 0); + ret = rn_addroute(v_arg, n_arg, head, + treenodes); + } + RTFREE(rt2); + } + } + return ret; } /* |