CVSROOT:        /cvs
Module name:    src
Changes by:     k...@cvs.openbsd.org    2023/01/06 07:29:47

Modified files:
        sys/netinet6   : nd6.c 

Log message:
Clarify nd6_option() return semantics

nd_opts_last is set only once in nd6_options() during struct init and
guaranteed non-NULL as it is set to the function's argument *opt which
is passed in as (struct_ptr + 1) in both callers.

nd6_option(), the internal helper, returns a pointer to the next option
or NULL, which means either "no option, ok" or "invalid option, fail".

Failure is signaled through nd_opts_last being NULL after nd6_option()
returned, which only happens if nd6_option() zeroed the whole *ndopts.

Move the two cases under mnemonic labels and zap the now obviously
redundant bzero() call in nd6_options().

OK claudio

Reply via email to