From owner-freebsd-stable Fri Jan 19 20:47:52 1996 Return-Path: owner-stable Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA05636 for stable-outgoing; Fri, 19 Jan 1996 20:47:52 -0800 (PST) Received: from rocky.sri.MT.net (rocky.sri.MT.net [204.182.243.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id UAA05625 Fri, 19 Jan 1996 20:47:48 -0800 (PST) Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id VAA17390; Fri, 19 Jan 1996 21:50:27 -0700 Date: Fri, 19 Jan 1996 21:50:27 -0700 From: Nate Williams Message-Id: <199601200450.VAA17390@rocky.sri.MT.net> To: stable@FreeBSD.org, current@FreeBSD.sri.MT.net, hackers@FreeBSD.org Subject: Possible solution to the Proxy-ARP bug enclosed Sender: owner-stable@FreeBSD.org Precedence: bulk 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 #include + #include #include #include #include *************** *** 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; } /*