kern/71474: route lookup does not skip interfaces marked down

Thomas Quinot thomas at FreeBSD.ORG
Wed Sep 8 06:06:50 PDT 2004

* Ruslan Ermilov, 2004-09-08 :

>  > ifconfig I1 netmask
>  > ifconfig I1 down
>  > ifconfig I2 netmask
>  > route add default
>  > 
>  > The default route will be set to on I1, not on I2 as
>  > expected.
>  > 
>  It's still a misconfiguration -- if you do not bring the I1 interface
>  down, the "interface" route for I2 will not be installed, and the
>  ifconfig(8) command will be aborted.  Anyway...

I am not sure I get what you mean. The point of this PR is that I *do*
bring I1 down, that the kernel has an unambiguous indication of how to
reach the specified gateway ('ping' works in the example
described above), and in spite of that the wrong interface is selected
when creating a route.

>  I reproduced this with two ng_eiface(4) nodes.  There's still a useful
>  option in the route(8) utility -- you can supply an explicit reference
>  to the interface, like this:
>  : route add default -ifp I1

Right, I was not aware of that option.

>  This is also vaguely documented in the route(8) manpage, FWIW:

*Vaguely* is the right term I think. :-)

Having browsed through the code, I think the interface lookup for route
additions should use a modified version of ifa_ifwithaddr ignoring
non-up interfaces.


    Thomas.Quinot at Cuivre.FR.EU.ORG

More information about the freebsd-bugs mailing list