ND_IFINFO() cannot be NULL, use inline read-only idiom for clarity
authorkn <kn@openbsd.org>
Wed, 23 Nov 2022 08:05:49 +0000 (08:05 +0000)
committerkn <kn@openbsd.org>
Wed, 23 Nov 2022 08:05:49 +0000 (08:05 +0000)
commit2c55d1bcfafde237f1d522a85140e2f07ef0c111
tree02bc26acf57507db9ecdd0b4fde0b267b843397e
parente41cd7290451ad18e161b4e619284b78f8fee863
ND_IFINFO() cannot be NULL, use inline read-only idiom for clarity

ND_IFINFO() always points at a valid struct nd_ifinfo;  ND6_LLINFO_DELAY
checks for NULL, while other cases in nd6_llinfo_timer() dereference it
unconditionally.

Inline all three per-case read-only usages rather than having one hoisted
*ndi pointer which could be used to write.

nd6_nbr.c already uses this `ND_IFINFO(ifp)->retrans' idiom which makes it
immediately clear that data is only read.

OK bluhm
sys/netinet6/nd6.c