Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Oct 2017 03:12:13 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   loopback routes miss RTF_PINNED flag
Message-ID:  <59EA589D.7020403@grosbein.net>

next in thread | raw e-mail | index | archive | help
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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59EA589D.7020403>