From 91e81d11cd34b0901502cbb4605d0c96f63e5e90 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:55 +0100 Subject: [PATCH] Revert "ipv6: fix ndisc_is_useropt() handling for PIO" This reverts commit 254636f1d38152d6b6c84f37e3a2eb2ae4595064. --- net/ipv6/ndisc.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 4f46b0a2e..14251347c 100755 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -226,7 +226,6 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev, return NULL; memset(ndopts, 0, sizeof(*ndopts)); while (opt_len) { - bool unknown = false; int l; if (opt_len < sizeof(struct nd_opt_hdr)) return NULL; @@ -262,23 +261,22 @@ struct ndisc_options *ndisc_parse_options(const struct net_device *dev, break; #endif default: - unknown = true; - } - if (ndisc_is_useropt(dev, nd_opt)) { - ndopts->nd_useropts_end = nd_opt; - if (!ndopts->nd_useropts) - ndopts->nd_useropts = nd_opt; - } else if (unknown) { - /* - * Unknown options must be silently ignored, - * to accommodate future extension to the - * protocol. - */ - ND_PRINTK(2, notice, - "%s: ignored unsupported option; type=%d, len=%d\n", - __func__, - nd_opt->nd_opt_type, - nd_opt->nd_opt_len); + if (ndisc_is_useropt(dev, nd_opt)) { + ndopts->nd_useropts_end = nd_opt; + if (!ndopts->nd_useropts) + ndopts->nd_useropts = nd_opt; + } else { + /* + * Unknown options must be silently ignored, + * to accommodate future extension to the + * protocol. + */ + ND_PRINTK(2, notice, + "%s: ignored unsupported option; type=%d, len=%d\n", + __func__, + nd_opt->nd_opt_type, + nd_opt->nd_opt_len); + } } next_opt: opt_len -= l;