Unlock IPv6 sysctl net.inet6.ip6.forwarding from net lock.
authorbluhm <bluhm@openbsd.org>
Sun, 14 Jul 2024 18:53:39 +0000 (18:53 +0000)
committerbluhm <bluhm@openbsd.org>
Sun, 14 Jul 2024 18:53:39 +0000 (18:53 +0000)
commit1f9e444e923b65200aa48a7199654b1001e5a68c
tree7ad7a0f3c87b20ba0e4366cdb3157818e2e6a974
parent39bc8ae496118835b834638658fc7af326a8a2dd
Unlock IPv6 sysctl net.inet6.ip6.forwarding from net lock.

Use atomic operations to read ip6_forwarding while processing packets
in the network stack.
To make clear where actually the router property is needed, use the
i_am_router variable based on ip6_forwarding.  It already existed
in nd6_nbr.  Move i_am_router setting up the call stack until all
users are independent.
The forwarding decisions in pf_test, pf_refragment6, ip6_input do
also not interfere.
Use a new array ipv6ctl_vars_unlocked to make transition of all the
integer sysctls easier.  Adapt IPv4 to the new style.

OK mvs@
12 files changed:
sys/net/if.c
sys/net/pf.c
sys/net/pf_norm.c
sys/netinet/ip_carp.c
sys/netinet/ip_icmp.c
sys/netinet/ip_input.c
sys/netinet6/icmp6.c
sys/netinet6/ip6_input.c
sys/netinet6/nd6.c
sys/netinet6/nd6.h
sys/netinet6/nd6_nbr.c
sys/netinet6/nd6_rtr.c