Page MenuHomeFreeBSD

loopback route needs RTF_PINNED flag
ClosedPublic

Authored by eugen_grosbein.net on Oct 20 2017, 8:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 2:54 PM
Unknown Object (File)
Thu, Oct 31, 2:53 PM
Unknown Object (File)
Thu, Oct 31, 2:52 PM
Unknown Object (File)
Thu, Oct 31, 2:32 PM
Unknown Object (File)
Oct 10 2024, 1:24 PM
Unknown Object (File)
Oct 3 2024, 10:07 AM
Unknown Object (File)
Oct 1 2024, 4:26 PM
Unknown Object (File)
Sep 29 2024, 7:43 PM
Subscribers

Details

Summary

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 https://svnweb.freebsd.org/base/head/sys/net/if.c?annotate=323170#l1711 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223129
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.