Having stuck my head into the kernel routing code for a few weeks now
I thought I would take a look at this problem since it partially
affects what I'm trying to do.

I don't think it's good idea to delete the downed routes.  You'll need
something to add the statics back when the interface comes back up
including the default route.

What I see going on is rn_match finds the most specific route whether
the route is up or down.  In your case it's finding the arp entry
which is an exact match.  Once the arp entry expires then the next
specific route will be the directly connected interface route which is
also down.  Thus it's broke.

I would probably add a flag argument to tell rn_match and rn_lookup to
skip entries that aren't RTF_UP.  rn_match is indeed very "hairy" and
I'm not sure where even to check for RTF_UP.  I haven't gained enough
experience points to wield the right tools to combat that beast.  I'll
leave it to a much higher leveled kernel sorcerer to craft the proper
enchantment.

dmo

Reply via email to