From: Roy Marples Date: Sat, 20 Jun 2026 16:39:45 +0000 (+0100) Subject: ND6: fix OOB reject mask for an undefined option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06f84e4a3f69754a5ece70919edd31ff7e191c3d;p=thirdparty%2Fdhcpcd.git ND6: fix OOB reject mask for an undefined option Reported by NVIDIA Project Vanessa --- diff --git a/src/ipv6nd.c b/src/ipv6nd.c index d8171f94..c219bdb9 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -1149,12 +1149,12 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, const struct sockaddr_in6 *from, if (dho->option == ndo.nd_opt_type) break; } - if (dho != NULL) - logwarnx("%s: reject RA (option %s) from %s", - ifp->name, dho->var, rap->sfrom); - else + if (i == ctx->nd_opts_len) logwarnx("%s: reject RA (option %d) from %s", ifp->name, ndo.nd_opt_type, rap->sfrom); + else + logwarnx("%s: reject RA (option %s) from %s", + ifp->name, dho->var, rap->sfrom); FREE_RAP(rap); return; }