Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Jun 2000 11:49:56 -0700
From:      Shiva Shenoy <shiva@yagosys.com>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: [Q] Clarification regarding RTF_PRCLONING and RTF_CLONING.
Message-ID:  <393801D4.84C60B59@yagosys.com>
References:  <3937F28A.5168FABC@yagosys.com> <200006021822.OAA42179@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman wrote:
> 
> <<On Fri, 02 Jun 2000 10:44:42 -0700, Shiva Shenoy <shiva@yagosys.com> said:
> 
> > 1. What is the difference between RTF_PRCLONING and RTF_CLONING
> >    I see that these 2 attributes are mutually exclusive.
> 
> One is enabled by the protocol and the other is enabled by the
> interface or by a routing process.  The former was a hack perpetrated
> by yours truly to make the routing table behave like a per-host
> cache.  I know better now, but I haven't had the time or inclination
> over the past four years to sit down and fix it.
> 
> > 2. Do ARP entries, cloned off of interface routes, get deleted
> >    when an interface route is brought down or deleted?
> 
> I don't recall.  I think there was some code to support that, but I
> don't know whether it was actually effective or not.
>



(All code snippets below are from net/route.c)

The code that may have been there is under RTM_DELETE. This call
here after the route has been deleted was intended to do that, I think.
rnh->rnh_walktree_from(rnh, dst, netmask,
                        rt_fixdelete, rt);

When an interface route is blown away, arp entries are not removed.
Reason: rt_fixdelete() - the first line precludes arp entries, cloned
off 
of the interface route from passing the test. 
The parent route is NULL for arp entries!
    if (rt->rt_parent == rt0 && !(rt->rt_flags & RTF_PINNED)) {

This can be fixed by changing the line in rtrequest: 

 if ((*ret_nrt)->rt_flags & RTF_PRCLONING) {
    rt->rt_parent = (*ret_nrt);

to: 

 if ((*ret_nrt)->rt_flags & (RTF_CLONING | RTF_PRCLONING)) {
    rt->rt_parent = (*ret_nrt);

Do you see any serious problem in this logic?


> > 3. How come ARP rtentries do not have rt_parent set to the
> >    interface routes that they are cloned off of? In fact they
> >    are set to NULL.
> 
> Because they are created from RTF_CLONING routes and not RTF_PRCLONING
> routes.  This may actually be a bug.

Thanks again for your feedback.

-Shiva Shenoy


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?393801D4.84C60B59>