From owner-freebsd-net Mon Dec 16 3:39:51 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 5A60D37B401 for ; Mon, 16 Dec 2002 03:39:49 -0800 (PST) Received: from web21205.mail.yahoo.com (web21205.mail.yahoo.com [216.136.131.248]) by mx1.FreeBSD.org (Postfix) with SMTP id 1FD7F43E4A for ; Mon, 16 Dec 2002 03:39:49 -0800 (PST) (envelope-from agius2@yahoo.com) Message-ID: <20021216113948.382.qmail@web21205.mail.yahoo.com> Received: from [62.176.101.114] by web21205.mail.yahoo.com via HTTP; Mon, 16 Dec 2002 03:39:48 PST Date: Mon, 16 Dec 2002 03:39:48 -0800 (PST) From: Svetoslav Agafonkin Subject: RTF_CLONING and RTF_WASCLONED flags - cloning mechanisum question To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 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 I've got this question about flags C (RTF_CLONING) and W (RTF_WASCLONED)(struct rtentry): Let there are two active interfaces - fxp0 (ethernet) i lo0 (loopback): flober# ifconfig fxp0: flags=8843 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=8810 mtu 1500 ppp0: flags=8010 mtu 1500 sl0: flags=c010 mtu 552 faith0: flags=8002 mtu 1500 lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 initial routing table : flober# 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 fxp0 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: for example: flober# ping 192.168.1.1 ... flober# 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 1 0 fxp0 192.168.1.1 00:06:29:b0:df:65 UHLW 0 4 lo0 How fxp0 interface is changed to lo0? Where exactly in the source (rtrequest)this is done? Svetoslav Agafonkin __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message