Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jan 1996 21:50:27 -0700
From:      Nate Williams <nate@sri.MT.net>
To:        stable@FreeBSD.org, current@FreeBSD.sri.MT.net, hackers@FreeBSD.org
Subject:   Possible solution to the Proxy-ARP bug enclosed
Message-ID:  <199601200450.VAA17390@rocky.sri.MT.net>

next in thread | raw e-mail | index | archive | help
Sorry for cross-posting this to so many lists, but I wanted to get as
much coverage as possible for this patch as possible.

For those who are wondering what this is all about, there is a problem
that affects all 4.4Lite derived systems with regards to ARP handling.
(This includes FreeBSD, NetBSD, and BSDi.)  The problem manifested
itself most often when remote hosts couldn't re-establish broken PPP
connections when using proxy-arp.

Bill Fenner has graciously spent some time looking at the problem, and
has sent me a patch which appears to have fixed my problem.  Until it's
tested further and others have had time to check it out it's not going
in the tree, but for those folks (like me) who are being annoyed by this
bug here is the patch Bill supplied me.

I've tested this patch as best I can, but I'd like to get other folks
to test this as well.


Nate
----
[Standard disclaimers applies]
*** in_rmx.c.orig	Sun Jul 23 01:44:59 1995
--- in_rmx.c	Fri Jan 19 14:33:57 1996
***************
*** 52,57 ****
--- 52,58 ----
  #include <sys/syslog.h>
  
  #include <net/if.h>
+ #include <net/if_dl.h>
  #include <net/route.h>
  #include <netinet/in.h>
  #include <netinet/in_systm.h>
***************
*** 77,82 ****
--- 78,84 ----
  {
  	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.
***************
*** 115,121 ****
  				      ? rt->rt_ifp->if_mtu
  				      : tcp_mssdflt + sizeof(struct tcpiphdr));
  
! 	return rn_addroute(v_arg, n_arg, head, treenodes);
  }
  
  /*
--- 117,148 ----
  				      ? rt->rt_ifp->if_mtu
  				      : tcp_mssdflt + sizeof(struct tcpiphdr));
  
! 	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 unresolved
! 		 * ARP request and delete it if so.
! 		 */
! 		rt2 = rtalloc1((struct sockaddr *)sin, 0,
! 				RTF_CLONING | RTF_PRCLONING);
! 		if (rt2 && rt2->rt_flags & RTF_LLINFO &&
! 			rt2->rt_flags & RTF_HOST &&
! 			rt2->rt_gateway &&
! 			rt2->rt_gateway->sa_family == AF_LINK &&
! #define SDL(s)	((struct sockaddr_dl *)s)
! 			SDL(rt2->rt_gateway)->sdl_alen == 0) {
! #undef SDL
! 			rtrequest(RTM_DELETE,
! 				  (struct sockaddr *)rt_key(rt2),
! 				  rt2->rt_gateway,
! 				  rt_mask(rt2), rt2->rt_flags, 0);
! 			RTFREE(rt2);
! 			ret = rn_addroute(v_arg, n_arg, head, treenodes);
! 		}
! 	}
! 	return ret;
  }
  
  /*




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601200450.VAA17390>