On Tue, Jul 03, 2001 at 04:54:29PM +0300, Iasen Kostoff wrote: > [...] > > You can't change host route to network route, or vise versa; destination > > is the Patricia's tree key, and it can't be changed. The only possible > > way is like I suggested: ``route add foo/32 -iface bar -cloning''. > > Yes I know, but ``route add foo -iface bar -cloning`` is meanless, I > think, because host route could not be cloned and I kernel should auto set > foo to foo/32 because of meanlessness of -host foo. > Could you please try the attached patch? It disallows cloning for host entries. > And is route add -host > foo -iface bar (without -cloning) could be used for something ? > Yes, it is currently used for proxy ARP type 1 entries: # arp -s 192.168.4.200 1:2:3:4:5:6 pub # netstat -rn | grep 192.168.4.200 192.168.4.200/32 1:2:3:4:5:6 ULS2c 0 0 rl0 The purpose of /32 here is to allow the call to rtalloc1() in arplookup() to match this route even if the SIN_PROXY flag (proxy ARP type 2; aka published (proxy only)) is set in the sin_other member of the sockaddr_inarp structure. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, [EMAIL PROTECTED] Sunbay Software AG, [EMAIL PROTECTED] FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age
Index: route.c =================================================================== RCS file: /home/ncvs/src/sys/net/route.c,v retrieving revision 1.59.2.2 diff -u -p -r1.59.2.2 route.c --- route.c 2001/05/14 08:23:48 1.59.2.2 +++ route.c 2001/07/03 15:08:41 @@ -476,10 +476,12 @@ rtrequest(req, dst, gateway, netmask, fl senderr(ESRCH); /* * If we are adding a host route then we don't want to put - * a netmask in the tree + * a netmask in the tree, not do we want to clone it. */ - if (flags & RTF_HOST) + if (flags & RTF_HOST) { netmask = 0; + flags &= ~(RTF_CLONING | RTF_PRCLONING); + } switch (req) { case RTM_DELETE: /*