Revert "ipv6: fix ndisc_is_useropt() handling for PIO"

This reverts commit 254636f1d3.
This commit is contained in:
Ksawlii 2024-11-24 00:23:55 +01:00
parent 6e343e2374
commit 91e81d11cd

View file

@ -226,7 +226,6 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev,
return NULL; return NULL;
memset(ndopts, 0, sizeof(*ndopts)); memset(ndopts, 0, sizeof(*ndopts));
while (opt_len) { while (opt_len) {
bool unknown = false;
int l; int l;
if (opt_len < sizeof(struct nd_opt_hdr)) if (opt_len < sizeof(struct nd_opt_hdr))
return NULL; return NULL;
@ -262,23 +261,22 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev,
break; break;
#endif #endif
default: default:
unknown = true; if (ndisc_is_useropt(dev, nd_opt)) {
} ndopts->nd_useropts_end = nd_opt;
if (ndisc_is_useropt(dev, nd_opt)) { if (!ndopts->nd_useropts)
ndopts->nd_useropts_end = nd_opt; ndopts->nd_useropts = nd_opt;
if (!ndopts->nd_useropts) } else {
ndopts->nd_useropts = nd_opt; /*
} else if (unknown) { * Unknown options must be silently ignored,
/* * to accommodate future extension to the
* Unknown options must be silently ignored, * protocol.
* to accommodate future extension to the */
* protocol. ND_PRINTK(2, notice,
*/ "%s: ignored unsupported option; type=%d, len=%d\n",
ND_PRINTK(2, notice, __func__,
"%s: ignored unsupported option; type=%d, len=%d\n", nd_opt->nd_opt_type,
__func__, nd_opt->nd_opt_len);
nd_opt->nd_opt_type, }
nd_opt->nd_opt_len);
} }
next_opt: next_opt:
opt_len -= l; opt_len -= l;