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, Mar 28, 11:09 AM
Unknown Object (File)
Mar 18 2024, 7:53 PM
Unknown Object (File)
Mar 7 2024, 1:06 PM
Unknown Object (File)
Dec 29 2023, 3:00 AM
Unknown Object (File)
Dec 25 2023, 8:15 AM
Unknown Object (File)
Dec 20 2023, 2:52 AM
Unknown Object (File)
Dec 19 2023, 9:17 PM
Unknown Object (File)
Nov 24 2023, 8:21 AM
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.