Page MenuHomeFreeBSD

loopback route needs RTF_PINNED flag

Authored by on Oct 20 2017, 8:57 PM.



When IP address is being added to an interface, a kernel installs loopback route.

Such route to local address created with ifa_maintain_loopback_route() function in misess RTF_PINNED flag, so that it cannot override possibly existing route to that address added
by a routing daemon. EEXIST is returned in such case.

This error is then propagated back to userland ioctl SIOCAIFADD breaking
interface configuration sequence. See also
for real world example.

Test Plan
  1. Use 'route get' command to make sure that loopback routes miss PINNED flag.
  2. Apply the patch, rebuild and reinstall the kernel.
  3. Reboot the system then use 'route get' command again to check for PINNED flag set for loopback routes.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gnn accepted this revision.Nov 3 2017, 5:33 PM
This revision is now accepted and ready to land.Nov 3 2017, 5:33 PM

I suspect this will also address PR 222647.

This revision was automatically updated to reflect the committed changes.