Page MenuHomeFreeBSD

IPv6: Set ifdisabled in the kernel rather than in rc
ClosedPublic

Authored by bz on Nov 22 2020, 10:22 PM.

Details

Summary

Enable ND6_IFF_IFDISABLED when the interface is created in the
kernel before return to user space.

This avoids a race when an interface is create by a program which
also calls ifconfig IF inet6 -ifdisabled and races with the
devd -> /etc/pccard_ether -> .. netif start IF -> ifdisabled
calls (the devd/rc framework disabling IPv6 again after the program
had enabled it already).

In case the global net.inet6.ip6.accept_rtadv was turned on,
we also default to enabling IPv6 on the interfaces, rather than
disabling them.

Reported by: Gert Doering (gert greenie.muc.de)
PR: 248172
Reviewed by:
MFC after: ???
Diff Review: ...

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bz requested review of this revision.Nov 22 2020, 10:22 PM
bz created this revision.
glebius added a subscriber: glebius.
glebius added inline comments.
sys/netinet6/nd6.c
276 ↗(On Diff #79871)

on the loopback interfaces

This revision is now accepted and ready to land.Nov 23 2020, 4:51 PM
sys/netinet6/nd6.c
276 ↗(On Diff #79871)

on the loopback interfaces

please ignore :)

Not sure why I'm asked to review this, not exactly my specialty, but it looks OK and sounds sensible.

In D27324#610809, @phk wrote:

Not sure why I'm asked to review this, not exactly my specialty, but it looks OK and sounds sensible.

@phk If I am not mistaken it was you who got us into the entire "I go to a conference and IPv6 is enabled on the wifi and I'll just have it and not be aware of it" original sysctls, so this flag pretty much exists because of you (unless of course I misremember). Good enough reason to add you to review ;-)

This revision was automatically updated to reflect the committed changes.