From owner-freebsd-net Wed Jul 4 0: 2:38 2001 Delivered-To: freebsd-net@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 741C237B406; Wed, 4 Jul 2001 00:02:22 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f6471qp58392; Wed, 4 Jul 2001 10:01:52 +0300 (EEST) (envelope-from ru) Date: Wed, 4 Jul 2001 10:01:52 +0300 From: Ruslan Ermilov To: Roman Le Houelleur Cc: freebsd-net , freebsd-stable Subject: Re: Setting ip addr deletes routes Message-ID: <20010704100152.B55338@sunbay.com> Mail-Followup-To: Roman Le Houelleur , freebsd-net , freebsd-stable References: <3B41FC84.8D4F7182@IPricot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B41FC84.8D4F7182@IPricot.com>; from roman@IPricot.com on Tue, Jul 03, 2001 at 07:10:28PM +0200 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 Tue, Jul 03, 2001 at 07:10:28PM +0200, Roman Le Houelleur wrote: > hi, > > > uname -a > FreeBSD roman.fr.ipricot.com 4.3-STABLE FreeBSD 4.3-STABLE #0: \ > Tue Jul 3 17:28:04 CEST 2001 \ > root@roman.fr.ipricot.com:/usr/src/sys/compile/ROMAN_SB i386 > > I have only updated src-sys, the rest of the system comes from > a 4.3 RC4. > > > ifconfig -a > rl0: flags=8843 mtu 1500 > inet 192.168.31.181 netmask 0xffffff00 broadcast 192.168.31.255 > ether 00:50:fc:01:a3:3c > media: autoselect (100baseTX) status: active > supported media: autoselect 100baseTX 100baseTX > 10baseT/UTP > 10baseT/UTP 100baseTX > vr0: flags=8843 mtu 1500 > inet 192.168.42.1 netmask 0xffffff00 broadcast 192.168.42.255 > ether 00:50:ba:05:9a:8f > media: autoselect (100baseTX ) status: active > supported media: autoselect 100baseTX 100baseTX > 10baseT/UTP > 10baseT/UTP none > sl0: flags=c010 mtu 552 > lo0: flags=8049 mtu 16384 > inet 127.0.0.1 netmask 0xff000000 > ppp0: flags=8010 mtu 1500 > > > netstat -rn > Destination Gateway Flags Netif Expire > default 192.168.31.254 UGSc 0 0 rl0 > 127.0.0.1 127.0.0.1 UH 0 0 lo0 > 192.168.31 link#1 UC 2 0 rl0 > => > 192.168.42 link#2 UC 0 0 vr0 > => > 195.154.74 link#1 UCSc 1 0 rl0 > => > > > ifconfig rl0 192.168.31.181 netmask 0xffffff00 > (yes, this is the same ip addr, but same results with another one) > > netstat -rn > Destination Gateway Flags Netif Expire > 127.0.0.1 127.0.0.1 UH 0 0 lo0 > 192.168.31 link#1 UC 2 0 rl0 > => > 192.168.42 link#2 UC 0 0 vr0 > => > > So, here is the question > 1. Is this a bug ? > 2. or is it a user process I should have updated too ? > 3. maybe a new functionnality I don't understand ? > This is 3). The second `ifconfig' first deleted IP address from an interface (see `route -vn monitor' output), then assigns the new one. Every routing table entry stores the pointer to the associated interface, and one of interface's addresses (see `route -vn get default' for example). There was a bug: if you changed the IP address of an interface, routes that point to this interface might still use the old IP address, and unnamed (with unspecified source IP address) datagrams used this old IP address. Old IP routing code invalidated only dynamic routes when interface goes down, or address is removed. The routing code has been modified recently to invalidate all routes, including static ones, when the address is deleted. See the comment in the sys/netinet/in_rmx.c file that starts from the words "This zaps old routes" for more details. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message