aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-04-16 22:31:52 +0000
committerPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-04-17 22:52:19 +0000
commite8081190617741e348fc85f17ff90b066407fc0f (patch)
treeb707d633b9f6eb6b98b371cfcf02a5a89c745b3f
parent05f2acd34483e9a2aa3d3b3d53e398cadab199ad (diff)
nd6: Remove anycast check in prelist_update
RFC 2462 is obsoleted by RFC 4862 and it made statements more clear than before. Considering SLAAC can't create anycast addresses by itself, remove its check. While here, update comments based on RFC 4862. Reviewed by: markj, zlei Differential Revision: https://reviews.freebsd.org/D56134
-rw-r--r--sys/netinet6/nd6_rtr.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index a27df537ecdc..2a73007d5118 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1613,14 +1613,13 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
pfxrtr_add(pr, dr);
/*
- * 5.5.3 (d). If the prefix advertised is not equal to the prefix of
+ * 5.5.3 (d). If the prefix advertised is not equal to the prefix of
* an address configured by stateless autoconfiguration already in the
- * list of addresses associated with the interface, and the Valid
- * Lifetime is not 0, form an address. We first check if we have
- * a matching prefix.
- * Note: we apply a clarification in rfc2462bis-02 here. We only
- * consider autoconfigured addresses while RFC 4862 simply said
- * "address".
+ * list of addresses associated with the interface (where "equal"
+ * means the two prefix lengths are the same and the first prefix-length
+ * bits of the prefixes are identical),
+ * and if the Valid Lifetime is not 0, form an address (and
+ * add it to the list). We first check if we have a matching prefix.
*/
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct in6_ifaddr *ifa6;
@@ -1630,22 +1629,10 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr,
continue;
ifa6 = (struct in6_ifaddr *)ifa;
-
- /*
- * We only consider autoconfigured addresses as per rfc2462bis.
- */
if (!(ifa6->ia6_flags & IN6_IFF_AUTOCONF))
continue;
/*
- * Spec is not clear here, but I believe we should concentrate
- * on unicast (i.e. not anycast) addresses.
- * XXX: other ia6_flags? detached or duplicated?
- */
- if ((ifa6->ia6_flags & IN6_IFF_ANYCAST) != 0)
- continue;
-
- /*
* Ignore the address if it is not associated with a prefix
* or is associated with a prefix that is different from this
* one. (pr is never NULL here)