loopback routes miss RTF_PINNED flag

Eugene Grosbein eugen at grosbein.net
Fri Oct 20 20:12:32 UTC 2017


Hi!

When IP address is being added to an interface, a kernel installs loopback route.
For P2P interfaces, we have local IP address and remote one.

A route to remote address is added with RTF_PINNED flag,
so that it overrides any possibly existing route to that address added
by a routing daemon and that's fine.

A route to local address created with ifa_maintain_loopback_route() function in
https://svnweb.freebsd.org/base/head/sys/net/if.c?annotate=323170#l1711
misess RTF_PINNED flag, so that it cannot override similar possibly existing route
and that's not fine as rtrequest1_fib() returns EEXIST in such case.
This error is then propagated back to userland ioctl SIOCAIFADD breaking
interface configuration sequence. See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223129
for real world example.

Is there a reason for such loopback routes to not have RTF_PINNED flag?


More information about the freebsd-net mailing list