From owner-freebsd-net@FreeBSD.ORG Fri Sep 26 08:23:52 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B767216A4B3 for ; Fri, 26 Sep 2003 08:23:52 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id B099E43FA3 for ; Fri, 26 Sep 2003 08:23:51 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 46D72654DF for ; Fri, 26 Sep 2003 16:23:50 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15959-01-7 for ; Fri, 26 Sep 2003 16:23:49 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id D61506547E for ; Fri, 26 Sep 2003 16:23:49 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 244282A; Fri, 26 Sep 2003 16:23:49 +0100 (BST) Date: Fri, 26 Sep 2003 16:23:49 +0100 From: Bruce M Simpson To: freebsd-net@freebsd.org Message-ID: <20030926152349.GI662@saboteur.dek.spc.org> Mail-Followup-To: freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NPukt5Otb9an/u20" Content-Disposition: inline Subject: Alternative fix for FreeBSD-SA-03:14.arp X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2003 15:23:52 -0000 --NPukt5Otb9an/u20 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Based on discussion between ru@ and I, there's a patch attached which tries to fix the problem without deleting GENMASK routes, and is stricter about not touching STATIC routes. Comments and reviews solicited, appreciated... Thanks! BMS --NPukt5Otb9an/u20 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="newarp.diff" --- if_ether.c.orig Mon Sep 22 21:11:59 2003 +++ if_ether.c Fri Sep 26 13:43:20 2003 @@ -922,9 +922,19 @@ if (why && create) { log(LOG_DEBUG, "arplookup %s failed: %s\n", inet_ntoa(sin.sin_addr), why); - return 0; + + if ((rt->rt_refcnt == 0) && + (rt->rt_flags & RTF_STATIC) == 0 && + (rt->rt_flags & (RTF_HOST|RTF_WASCLONED)) == + (RTF_HOST|RTF_WASCLONED)) { + rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), + rt->rt_gateway, rt_mask(rt), + rt->rt_flags, 0); + } + + return (0); } else if (why) { - return 0; + return (0); } return ((struct llinfo_arp *)rt->rt_llinfo); } --NPukt5Otb9an/u20--