From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 8 12:50:25 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBE6916A4CE for ; Wed, 8 Sep 2004 12:50:25 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC30643D39 for ; Wed, 8 Sep 2004 12:50:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i88CoPor086192 for ; Wed, 8 Sep 2004 12:50:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i88CoPBQ086191; Wed, 8 Sep 2004 12:50:25 GMT (envelope-from gnats) Date: Wed, 8 Sep 2004 12:50:25 GMT Message-Id: <200409081250.i88CoPBQ086191@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Ruslan Ermilov Subject: Re: kern/71474: route lookup does not skip interfaces marked down X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ruslan Ermilov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2004 12:50:25 -0000 The following reply was made to PR kern/71474; it has been noted by GNATS. From: Ruslan Ermilov To: Thomas Quinot Cc: bug-followup@freebsd.org Subject: Re: kern/71474: route lookup does not skip interfaces marked down Date: Wed, 8 Sep 2004 15:49:26 +0300 On Wed, Sep 08, 2004 at 02:26:29PM +0200, Thomas Quinot wrote: > * Ruslan Ermilov, 2004-09-08 : > > > But your test case only applies to P2P interfaces, when both ends > > of two P2P interfaces share the same IP address. > > No, this is not the case. Only the remote ends of the two interfaces > share the same IP address. I described that test case because using gif > interfaces makes it easier to reproduce, but I initially observed this > symptom with one bge and one Intel wireless (ndis) interface. > That's what I meant (two remote ends of both interfaces). > > I do not see how this could apply to broadcast interfaces. > > As follows. Consider a machine with two Ethernet interfaces I1 and I2. > > ifconfig I1 192.168.0.1 netmask 255.255.255.0 > ifconfig I1 down > ifconfig I2 192.168.0.2 netmask 255.255.255.0 > route add default 192.168.0.254 > > The default route will be set to 192.168.0.254 on I1, not on I2 as > expected. > It's still a misconfiguration -- if you do not bring the I1 interface down, the "interface" route for I2 will not be installed, and the ifconfig(8) command will be aborted. Anyway... I reproduced this with two ng_eiface(4) nodes. There's still a useful option in the route(8) utility -- you can supply an explicit reference to the interface, like this: : route add default 192.168.0.254 -ifp I1 This is also vaguely documented in the route(8) manpage, FWIW: : In a change or add command where the destination and gateway are not suf- : ficient to specify the route ..., the -ifp or -ifa modifiers may be used : to determine the interface or interface address. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer