]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
ND6: fix OOB reject mask for an undefined option
authorRoy Marples <roy@marples.name>
Sat, 20 Jun 2026 16:39:45 +0000 (17:39 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Jun 2026 16:39:45 +0000 (17:39 +0100)
Reported by NVIDIA Project Vanessa

src/ipv6nd.c

index d8171f94073b3a238048a87347629d6902b9a2ab..c219bdb90bb16c4855b62e6e7bda16d04497c70f 100644 (file)
@@ -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;
                }