From owner-freebsd-net Mon Nov 26 17:54: 8 2001 Delivered-To: freebsd-net@freebsd.org Received: from mailrelay.netcologne.de (mailrelay.netcologne.de [194.8.194.96]) by hub.freebsd.org (Postfix) with ESMTP id 52E1F37B419; Mon, 26 Nov 2001 17:53:54 -0800 (PST) Received: from design.freestyling.de (design.freestyling.de [195.14.253.182]) by mailrelay.netcologne.de (8.11.6/8.11.6) with ESMTP id fAR1ro729059; Tue, 27 Nov 2001 02:53:50 +0100 (MET) X-Received: from tick.sc.omation.com (64-58-167-31.cbi.cox-oc.net [64.58.167.31] (may be forged)) by design.freestyling.de (8.11.3/8.11.3) with ESMTP id fAR1vF294206 for ; Tue, 27 Nov 2001 02:57:15 +0100 (CET) (envelope-from pherman@frenchfries.net) X-Received: from tick.sc.omation.com (tick.sc.omation.com [192.168.128.2]) by tick.sc.omation.com (8.11.6/8.11.6) with ESMTP id fAR1qnE44864; Mon, 26 Nov 2001 17:52:49 -0800 (PST) (envelope-from pherman@frenchfries.net) Date: Mon, 26 Nov 2001 17:52:49 -0800 (PST) From: Paul Herman X-X-Sender: To: Ruslan Ermilov Cc: Subject: Re: arp_rtrequest: bad gateway value In-Reply-To: <20011123160634.I49441-100000@tick.sc.omation.com> Message-ID: <20011126173433.W39004-100000@tick.sc.omation.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 23 Nov 2001, Paul Herman wrote: > On Thu, 22 Nov 2001, Ruslan Ermilov wrote: > > > On Wed, Nov 21, 2001 at 05:32:27PM -0800, Paul Herman wrote: > > > Hi, > > > > > > I'd like to pick some brains before I file a PR. > > > > > There's already a PR open on this, kern/29170. > > > > [...] > > Here's a patch against 4.4-RELEASE that fixes this problem. As mentioned before, the problem happens when a gateway with the RTF_LLINFO set gets polluted with non-link information. routed and route are both culprits. BTW, KAME does this as well by putting AF_INET6 data into gateways with the RTF_LLINFO flag set, which I don't think is a good idea, but it calls rt_setgate() directly and isn't affected by this patch. I've decided to have the kernel leave the gateway untouched and continue, rather than having the kernel return EINVAL. This produces the least astonishment :-) Please review and if it's OK, I'll send it to gnats for the audit trail. Thanks, -Paul. Index: sys/net/rtsock.c =================================================================== RCS file: /mnt/ncvs/src/sys/net/rtsock.c,v retrieving revision 1.44.2.4 diff -u -r1.44.2.4 rtsock.c --- sys/net/rtsock.c 2001/07/11 09:37:37 1.44.2.4 +++ sys/net/rtsock.c 2001/11/27 01:33:03 @@ -399,6 +399,14 @@ break; case RTM_CHANGE: + /* Don't let the user specify non-link information + * for a gateway if the RTF_LLINFO flag is set. + * We'll just leave the gateway alone. + */ + if (gate && (rt->rt_flags & RTF_LLINFO) && + gate->sa_family != AF_LINK) + gate = rt->rt_gateway; + if (gate && (error = rt_setgate(rt, rt_key(rt), gate))) senderr(error); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message