Dead since 2017 sys/netinet6/nd6_rtr.c r1.163
    Remove sending of router solicitations and processing of router
    advertisements from the kernel. It's handled by slaacd(8) these days.

Multiple prefixes are fine, so sysctl(2) net.inet6.icmp6.nd6_debug does not
warn about it like it does for, e.g., duplicate MTU options, so don't do
anything with this option.

Remove access macros for other unused options while here.
All under _KERNEL.

tcpdump(8)/rad(8)/slaacd(8) keep showing/sending/receiving this option when
running this diff on both router and client.

Feedback? Objection? OK?

NB:  I suspect that nd6.h's union nd_opt can be cleaned up/reduced in
size, but nd6.c's nd6_option() and nd6_options() are not trivial, so
here goes the option handling alone for now.

diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 1c7bf7d985b..9c7f2c422ca 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -251,13 +251,6 @@ nd6_options(union nd_opts *ndopts)
                        }
                        break;
                case ND_OPT_PREFIX_INFORMATION:
-                       if (ndopts->nd_opt_array[nd_opt->nd_opt_type] == 0) {
-                               ndopts->nd_opt_array[nd_opt->nd_opt_type]
-                                       = nd_opt;
-                       }
-                       ndopts->nd_opts_pi_end =
-                               (struct nd_opt_prefix_info *)nd_opt;
-                       break;
                case ND_OPT_DNSSL:
                case ND_OPT_RDNSS:
                        /* Don't warn */
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index 2b441bd97e7..8d67c66d961 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -127,10 +127,6 @@ union nd_opts {
 };
 #define nd_opts_src_lladdr     nd_opt_each.src_lladdr
 #define nd_opts_tgt_lladdr     nd_opt_each.tgt_lladdr
-#define nd_opts_pi             nd_opt_each.pi_beg
-#define nd_opts_pi_end         nd_opt_each.pi_end
-#define nd_opts_rh             nd_opt_each.rh
-#define nd_opts_mtu            nd_opt_each.mtu
 #define nd_opts_search         nd_opt_each.search
 #define nd_opts_last           nd_opt_each.last
 #define nd_opts_done           nd_opt_each.done

Reply via email to