From owner-freebsd-net Wed Mar 21 9:44: 0 2001 Delivered-To: freebsd-net@freebsd.org Received: from homer.softweyr.com (bsdconspiracy.net [208.187.122.220]) by hub.freebsd.org (Postfix) with ESMTP id 5FD1637B719; Wed, 21 Mar 2001 09:43:52 -0800 (PST) (envelope-from wes@softweyr.com) Received: from [127.0.0.1] (helo=softweyr.com ident=bc8ebe9722aec4a835b4a4aa3e68a996) by homer.softweyr.com with esmtp (Exim 3.16 #1) id 14fmcM-0000fz-00; Wed, 21 Mar 2001 10:41:54 -0700 Message-ID: <3AB8E7E2.36F360AA@softweyr.com> Date: Wed, 21 Mar 2001 10:41:54 -0700 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Ruslan Ermilov Cc: Garrett Wollman , net@FreeBSD.org Subject: Re: Indirect routes with indirect gateways, bugfix References: <20010321133611.A62997@sunbay.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Ruslan Ermilov wrote: > > Hi! > > The routing code (bogusly?) allows to add an indirect route with > also indirect gateway. This results in some nasty bugs: > > : Script started on Wed Mar 21 13:17:47 2001 > : > : freebsd# netstat -rn > : Routing tables > : > : Internet: > : Destination Gateway Flags Refs Use Netif Expire > : 127.0.0.1 127.0.0.1 UH 0 0 lo0 > : 192.168.1 link#1 UC 0 0 rl0 => > : > : freebsd# route add -net 10 1.2.3.4 > : route: writing to routing socket: Network is unreachable > : add net 10: gateway 1.2.3.4: Network is unreachable > : > : freebsd# route add default 192.168.1.1 > : add net default: gateway 192.168.1.1 > : > : freebsd# route add -net 10 1.2.3.4 > : add net 10: gateway 1.2.3.4 > : > : freebsd# ping -c1 10.0.0.1 > : PING 10.0.0.1 (10.0.0.1): 56 data bytes > : > : --- 10.0.0.1 ping statistics --- > : 1 packets transmitted, 0 packets received, 100% packet loss > : > : freebsd# dmesg | tail -2 > : arplookup 1.2.3.4 failed: host is not on local network > : arpresolve: can't allocate llinfo for 1.2.3.4rt > : freebsd# > : > : Script done on Wed Mar 21 13:19:00 2001 > > I have searched the CSRG SCCS logs, and found that the relevant code > was added in route.c, version 7.22 (well, 7.22 is actually a part of > 7.23 that went into Net/2 release). I have marked the relevant text > from the commit log with circumflexes: > > [...] > > Unless someone has a good motivation for not doing this, I am going > to commit the attached patch that disallows indirect routes with > indirect gateways. This allows a crude sort of "policy routing", if that is of any value. I don't see what it hurts, or any reason to remove it. A misconfigured routing table is a system administration problem, not a code problem. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message