From owner-freebsd-net Mon Dec 16 6:46: 8 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD8F137B401 for ; Mon, 16 Dec 2002 06:46:04 -0800 (PST) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id B778D43EB2 for ; Mon, 16 Dec 2002 06:45:47 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) by whale.sunbay.crimea.ua (8.12.6/8.12.6/Sunbay) with ESMTP id gBGEjXkf021467 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 16 Dec 2002 16:45:40 +0200 (EET) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.6/8.12.6/Submit) id gBGEjVbX021462; Mon, 16 Dec 2002 16:45:31 +0200 (EET) Date: Mon, 16 Dec 2002 16:45:31 +0200 From: Ruslan Ermilov To: Svetoslav Agafonkin Cc: freebsd-net@FreeBSD.ORG Subject: Re: RTF_CLONING and RTF_WASCLONED flags - cloning mechanisum question Message-ID: <20021216144531.GB13297@sunbay.com> References: <20021216113948.382.qmail@web21205.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aM3YZ0Iwxop3KEKx" Content-Disposition: inline In-Reply-To: <20021216113948.382.qmail@web21205.mail.yahoo.com> User-Agent: Mutt/1.5.1i 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 --aM3YZ0Iwxop3KEKx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable It's done in the arp_rtrequest() function and is controlled by the net.link.ether.inet.useloopback sysctl. On Mon, Dec 16, 2002 at 03:39:48AM -0800, Svetoslav Agafonkin wrote: >=20 > flober# uname -a > FreeBSD flober 4.7-RELEASE FreeBSD 4.7-RELEASE #5: > Thu Dec 5 22:01:28 EET 2002 > root@flober:/usr/obj/usr/src/sys/AKERNEL i386 >=20 > I've got this question about flags C (RTF_CLONING) > and W (RTF_WASCLONED)(struct rtentry): >=20 > Let there are two active interfaces - fxp0 > (ethernet) i lo0 (loopback): >=20 > flober# ifconfig >=20 > fxp0: > flags=3D8843 mtu > 1500 > inet 192.168.1.1 netmask 0xffffff00 broadcast > 192.168.1.255 > ether 00:06:29:b0:df:65 > media: Ethernet autoselect (none) > status: no carrier > lp0: flags=3D8810 mtu > 1500 > ppp0: flags=3D8010 mtu 1500 > sl0: flags=3Dc010 mtu > 552 > faith0: flags=3D8002 mtu 1500 > lo0: flags=3D8049 mtu > 16384 > inet 127.0.0.1 netmask 0xff000000 >=20 >=20 > initial routing table : >=20 > flober# netstat -rn > Routing tables >=20 > 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 fxp0 >=20 > the flag C in the entry route to 192.168.1.0/24 means > that every time we use that entry (via > rtalloc/rtrequest/rtrequest_ign(/sys/net/route.c)) it > will be cloned (i.e. a new entry will be created > using the old a a template).Let's see: >=20 > for example: >=20 > flober# ping 192.168.1.1 >=20 > ... >=20 > flober# netstat -rn > Routing tables >=20 > Internet: > Destination Gateway Flags Refs =20 > Use Netif Expire > 127.0.0.1 127.0.0.1 UH 0=20 > 0 lo0 > 192.168.1 link#1 UC 1=20 > 0 fxp0 > 192.168.1.1 00:06:29:b0:df:65 UHLW 0=20 > 4 lo0 >=20 > How fxp0 interface is changed to lo0? Where exactly in > the source (rtrequest)this is done? >=20 >=20 > Svetoslav Agafonkin >=20 >=20 >=20 >=20 > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message --=20 Ruslan Ermilov Sysadmin and 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 --aM3YZ0Iwxop3KEKx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE9/ecKUkv4P6juNwoRAshoAJ9VFmLUcGvzU9YvZqd5ATgM9LgtDgCfR9VB oQscOL2d559WRZUoJjTNqVo= =2WbC -----END PGP SIGNATURE----- --aM3YZ0Iwxop3KEKx-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message