Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jul 2001 18:10:32 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Iasen Kostoff <tbyte@tbyte.org>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: adding a route to host via interface
Message-ID:  <20010703181032.A65571@sunbay.com>
In-Reply-To: <Pine.BSF.4.21.0107031644290.35452-100000@shadow.otel.net>; from tbyte@tbyte.org on Tue, Jul 03, 2001 at 04:54:29PM %2B0300
References:  <20010703162556.E39090@sunbay.com> <Pine.BSF.4.21.0107031644290.35452-100000@shadow.otel.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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,
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

--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=p

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:
 		/*

--Q68bSM7Ycu6FN28Q--

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?20010703181032.A65571>