]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
IPv6: set ifdisabled in the kernel rather than in rc
authorbz <bz@FreeBSD.org>
Wed, 25 Nov 2020 20:58:01 +0000 (20:58 +0000)
committerbz <bz@FreeBSD.org>
Wed, 25 Nov 2020 20:58:01 +0000 (20:58 +0000)
commit43e7814da7e651427584c1b714c523aa20141b2d
tree9e358c3823a8b078666b61a6da247485bd07f990
parent26290e631204bb244982db497e05329267ffdb89
IPv6: set ifdisabled in the kernel rather than in rc

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.

PR: 248172
Reported by: Gert Doering (gert greenie.muc.de)
Reviewed by: glebius (, phk)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27324
libexec/rc/network.subr
sys/netinet6/nd6.c