tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] Deletion of route scrubs ifa flag IFA_ROUTE even if it's not the automatic route



On Mon, Mar 09, 2009 at 10:16:27AM +0000, Roy Marples wrote:
> On Tue, 2009-03-03 at 22:47 +0000, Roy Marples wrote:
> > To make ammends, attached is a patch to fix this. It is intended for
> > pullup to netbsd-5.
> 
> And here is a different patch.
> We add a new function, rt_ifa_connected which returns 1 if the route is
> the connected route (prefix, subnet, etc) for the ifa.
> This makes the code in rtsock.c and route.c a lot simpler. I've also
> added some debug messages via the existing RT_DPRINTF define.
> 
> For reference, I've also added a patch which applies this before my
> origonal patch was comitted to show the intent of what we're trying to
> do here.
> 
> I think this pretty much covers everything now. Anyone have any issues
> with this before I commit?

Please separate the cosmetic changes from the functional changes
before you commit.

Avoid accessing _rt_key except by using the accessor, rt_getkey().

Perhaps the following code logically belongs in rt_replace_ifa()?

+                               if (oifa && oifa->ifa_flags & IFA_ROUTE &&      
+                                   rt_ifa_connected(rt, oifa))                 
+                               {                                               
+                                       RT_DPRINTF("rt->_rt_key = %p, "         
+                                           "change deleted IFA_ROUTE\n",       
+                                           (void *)rt->_rt_key);               
+                                       oifa->ifa_flags &= ~IFA_ROUTE;          
+                                       if (rt_ifa_connected(rt, ifa)) {        
+                                               RT_DPRINTF("rt->_rt_key = %p, " 
+                                                   "change added IFA_ROUTE\n", 
+                                                   (void *)rt->_rt_key);       
                                                ifa->ifa_flags |= IFA_ROUTE;    

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933


Home | Main Index | Thread Index | Old Index