CVSROOT:        /cvs
Module name:    src
Changes by:     bl...@cvs.openbsd.org   2024/06/20 13:25:42

Modified files:
        sys/net        : if.c pf.c pf_norm.c 
        sys/netinet    : ip_carp.c 
        sys/netinet6   : icmp6.c ip6_forward.c ip6_input.c ip6_var.h 
                         nd6.c nd6_nbr.c 

Log message:
Read IPv6 forwarding value only once while processing a packet.

IPv4 uses IP_FORWARDING to pass down a consistent value of
net.inet.ip.forwarding down the stack.  This is needed for unlocking
sysctl.  Do the same for IPv6.

Read ip6_forwarding once in ip6_input_if() and pass down IPV6_FORWARDING
as flags to ip6_ours(), ip6_hbhchcheck(), ip6_forward().  Replace
the srcrt value with IPV6_REDIRECT flag for consistency with IPv4.

To have common syntax with IPv4, use ip6_forwarding == 0 checks
instead of !ip6_forwarding.  This will also make it easier to
implement net.inet6.ip6.forwarding=2 for IPsec only forwarding
later.

In nd6_ns_input() and nd6_na_input() read ip6_forwarding once and
store it in i_am_router.  The variable name has been chosen to avoid
confusion with is_router, which indicates router flag of the packet.
Reading of ip6_forwarding is done independently from ip6_input_if(),
consistency does not really matter.  One is for ND router behavior
the other for forwarding.  Again use the ip6_forwarding != 0 check,
so when ip6_forwarding IPsec only value 2 gets implemented, it will
behave like a router.

OK deraadt@ sashan@ florian@ claudio@

Reply via email to