Date: Mon, 16 Dec 2002 03:39:48 -0800 (PST) From: Svetoslav Agafonkin <agius2@yahoo.com> To: freebsd-net@freebsd.org Subject: RTF_CLONING and RTF_WASCLONED flags - cloning mechanisum question Message-ID: <20021216113948.382.qmail@web21205.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500 ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500 sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 552 faith0: flags=8002<BROADCAST,MULTICAST> mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021216113948.382.qmail>