Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2001 10:01:52 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Roman Le Houelleur <roman@IPricot.com>
Cc:        freebsd-net <freebsd-net@FreeBSD.ORG>, freebsd-stable <freebsd-stable@FreeBSD.ORG>
Subject:   Re: Setting ip addr deletes routes
Message-ID:  <20010704100152.B55338@sunbay.com>
In-Reply-To: <3B41FC84.8D4F7182@IPricot.com>; from roman@IPricot.com on Tue, Jul 03, 2001 at 07:10:28PM %2B0200
References:  <3B41FC84.8D4F7182@IPricot.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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 <full-duplex> 100baseTX
> 10baseT/UTP
>      <full-duplex> 10baseT/UTP 100baseTX <hw-loopback>
>  vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>      inet 192.168.42.1 netmask 0xffffff00 broadcast 192.168.42.255
>      ether 00:50:ba:05:9a:8f 
>      media: autoselect (100baseTX <full-duplex>) status: active
>      supported media: autoselect 100baseTX <full-duplex> 100baseTX
> 10baseT/UTP
>      <full-duplex> 10baseT/UTP none
>  sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 552
>  lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>         inet 127.0.0.1 netmask 0xff000000 
>  ppp0: flags=8010<POINTOPOINT,MULTICAST> 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-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010704100152.B55338>