Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178300210
D55229.1796460826.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
18 KB
Referenced Files
None
Subscribers
None
D55229.1796460826.diff
View Options
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -271,6 +271,8 @@
printf(" temporary");
if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0)
printf(" prefer_source");
+ if ((flags6 & IN6_IFF_OPTIMISTIC) != 0)
+ printf(" optimistic");
}
@@ -730,6 +732,8 @@
DEF_CMD("eui64", 0, setip6eui64),
DEF_CMD("stableaddr", ND6_IFF_STABLEADDR, setnd6flags),
DEF_CMD("-stableaddr", -ND6_IFF_STABLEADDR, setnd6flags),
+ DEF_CMD("optimistic", IN6_IFF_OPTIMISTIC, setip6flags),
+ DEF_CMD("-optimistic", -IN6_IFF_OPTIMISTIC, setip6flags),
};
static struct afswtch af_inet6 = {
diff --git a/share/man/man4/inet6.4 b/share/man/man4/inet6.4
--- a/share/man/man4/inet6.4
+++ b/share/man/man4/inet6.4
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 31, 2026
+.Dd November 25, 2026
.Dt INET6 4
.Os
.Sh NAME
@@ -306,6 +306,15 @@
.Tn IPv6
interface addresses are configured or when there are changes to
link-layer interface addresses.
+.It Dv IPV6CTL_USE_OPTIMISTIC
+.Pq ip6.use_optimistic
+Boolean: enable/disable Optimistic DAD
+.Pq RFC 4429
+for autoconfigured addresses.
+If enabled, an autoconfigured address is available for use
+while duplicate address detection is still in progress.
+It has no effect if the node acts as a router.
+Defaults to on.
.It Dv IPV6CTL_AUTO_FLOWLABEL
.Pq ip6.auto_flowlabel
Boolean: enable/disable automatic filling of
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -364,6 +364,8 @@
((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \
(u_int32_t)((time_uptime - (a)->ia6_updatetime)) >= \
(a)->ia6_lifetime.ia6t_vltime)
+#define IFA6_IS_AVOIDED(a) \
+ (IFA6_IS_DEPRECATED(a) || ((a)->ia6_flags & IN6_IFF_OPTIMISTIC) != 0)
#endif /* _KERNEL */
/*
@@ -644,7 +646,8 @@
#define IPV6CTL_MAXFRAGSPERPACKET 53 /* Max fragments per packet */
#define IPV6CTL_MAXFRAGBUCKETSIZE 54 /* Max reassembly queues per bucket */
#define IPV6CTL_GRAND_COUNT 55
-#define IPV6CTL_MAXID 56
+#define IPV6CTL_USE_OPTIMISTIC 56
+#define IPV6CTL_MAXID 57
#endif /* __BSD_VISIBLE */
/*
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1093,8 +1093,17 @@
* an interface with ND6_IFF_IFDISABLED.
*/
if (in6if_do_dad(ifp) &&
- (hostIsNew || (ifp->if_inet6->nd_flags & ND6_IFF_IFDISABLED)))
- ia->ia6_flags |= IN6_IFF_TENTATIVE;
+ (hostIsNew || (ifp->if_inet6->nd_flags & ND6_IFF_IFDISABLED))) {
+ /*
+ * RFC 4429 section 3: A router SHOULD NOT configure an
+ * Optimistic Address. Optimistic DAD SHOULD only be used
+ * when the implementation is aware that the address is
+ * based on a most likely unique interface identifier.
+ * XXX: A host that does not know the SLLAO of its router
+ * SHOULD NOT configure a new address as Optimistic.
+ */
+ in6_ifa_need_dad(ia);
+ }
/* notify other subsystems */
error = in6_notify_ifa(ifp, ia, ifra, hostIsNew);
@@ -1134,8 +1143,8 @@
}
}
- /* Perform DAD, if the address is TENTATIVE. */
- if ((ia->ia6_flags & IN6_IFF_TENTATIVE)) {
+ /* Perform DAD, if the address is TENTATIVE or OPTIMISTIC. */
+ if ((ia->ia6_flags & IN6_IFF_NEED_DAD) != 0) {
int delay, mindelay, maxdelay;
delay = 0;
@@ -2013,11 +2022,11 @@
int dst_scope = in6_addrscope(dst), blen = -1, tlen;
struct ifaddr *ifa;
struct in6_ifaddr *besta = NULL;
- struct in6_ifaddr *dep[2]; /* last-resort: deprecated */
+ struct in6_ifaddr *dep[4]; /* last-resort: optimistic/deprecated */
NET_EPOCH_ASSERT();
- dep[0] = dep[1] = NULL;
+ dep[0] = dep[1] = dep[2] = dep[3] = NULL;
/*
* We first look for addresses in the same scope.
@@ -2034,12 +2043,16 @@
continue; /* don't use this interface */
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DETACHED)
continue;
+ if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_OPTIMISTIC) {
+ if (V_ip6_use_optimistic)
+ dep[0] = (struct in6_ifaddr *)ifa;
+ continue;
+ }
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DEPRECATED) {
if (V_ip6_use_deprecated)
- dep[0] = (struct in6_ifaddr *)ifa;
+ dep[1] = (struct in6_ifaddr *)ifa;
continue;
}
-
if (dst_scope == in6_addrscope(IFA_IN6(ifa))) {
/*
* call in6_matchlen() as few as possible
@@ -2068,22 +2081,26 @@
continue; /* don't use this interface */
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DETACHED)
continue;
+ if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_OPTIMISTIC) {
+ if (V_ip6_use_optimistic)
+ dep[2] = (struct in6_ifaddr *)ifa;
+ continue;
+ }
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DEPRECATED) {
if (V_ip6_use_deprecated)
- dep[1] = (struct in6_ifaddr *)ifa;
+ dep[3] = (struct in6_ifaddr *)ifa;
continue;
}
-
return (struct in6_ifaddr *)ifa;
}
- /* use the last-resort values, that are, deprecated addresses */
- if (dep[0])
- return dep[0];
- if (dep[1])
- return dep[1];
+ /* use the last-resort values */
+ for (int i = 0; i < nitems(dep); i++) {
+ if (dep[i] != NULL)
+ return (dep[i]);
+ }
- return NULL;
+ return (NULL);
}
/*
@@ -2101,9 +2118,9 @@
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
ia = (struct in6_ifaddr *)ifa;
- if (ia->ia6_flags & IN6_IFF_TENTATIVE) {
+ if ((ia->ia6_flags & IN6_IFF_NEED_DAD) != 0) {
/*
- * The TENTATIVE flag was likely set by hand
+ * The TENTATIVE/OPTIMISTIC flag was likely set by hand
* beforehand, implicitly indicating the need for DAD.
* We may be able to skip the random delay in this
* case, but we impose delays just in case.
@@ -2134,6 +2151,19 @@
}
SYSINIT(in6_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, in6_init, NULL);
+void
+in6_ifa_need_dad(struct in6_ifaddr *ia)
+{
+
+ if ((ia->ia6_flags & IN6_IFF_OPTIMISTIC) != 0 ||
+ (V_ip6_use_optimistic && !V_ip6_forwarding &&
+ (ia->ia6_flags & IN6_IFF_AUTOCONF) != 0)) {
+ ia->ia6_flags &= ~IN6_IFF_TENTATIVE;
+ ia->ia6_flags |= IN6_IFF_OPTIMISTIC;
+ } else
+ ia->ia6_flags |= IN6_IFF_TENTATIVE;
+}
+
int
in6if_do_dad(struct ifnet *ifp)
{
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -358,3 +358,6 @@
log_cannot_forward, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(ip6_log_cannot_forward), 1,
"Log packets that cannot be forwarded");
+SYSCTL_BOOL(_net_inet6_ip6, IPV6CTL_USE_OPTIMISTIC, use_optimistic,
+ CTLFLAG_VNET | CTLFLAG_RWTUN, &VNET_NAME(ip6_use_optimistic), 0,
+ "Enable RFC4429 optimistic DAD");
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -353,10 +353,12 @@
/*
* Rule 3: Avoid deprecated addresses. Note that the case of
* !ip6_use_deprecated is already rejected above.
+ * RFC 4429 section 2.1: treat optimistic addresses
+ * equivalently to deprecated addresses.
*/
- if (!IFA6_IS_DEPRECATED(ia_best) && IFA6_IS_DEPRECATED(ia))
+ if (!IFA6_IS_AVOIDED(ia_best) && IFA6_IS_AVOIDED(ia))
NEXT(3);
- if (IFA6_IS_DEPRECATED(ia_best) && !IFA6_IS_DEPRECATED(ia))
+ if (IFA6_IS_AVOIDED(ia_best) && !IFA6_IS_AVOIDED(ia))
REPLACE(3);
/* Rule 4: Prefer home addresses */
diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -482,7 +482,9 @@
#define IN6_IFF_AUTOCONF 0x40 /* autoconfigurable address. */
#define IN6_IFF_TEMPORARY 0x80 /* temporary (anonymous) address. */
#define IN6_IFF_PREFER_SOURCE 0x0100 /* preferred address for SAS */
+#define IN6_IFF_OPTIMISTIC 0x0200 /* optimistic address */
+#define IN6_IFF_NEED_DAD (IN6_IFF_TENTATIVE|IN6_IFF_OPTIMISTIC)
/* do not input/output */
#define IN6_IFF_NOTREADY (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED)
@@ -904,6 +906,7 @@
void in6_purgeaddr(struct ifaddr *);
void in6_purgeifaddr(struct in6_ifaddr *);
int in6if_do_dad(struct ifnet *);
+void in6_ifa_need_dad(struct in6_ifaddr *);
void in6_savemkludge(struct in6_ifaddr *);
uint32_t in6_ifmtu(const struct ifnet *);
struct rib_head *in6_inithead(uint32_t fibnum);
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -342,9 +342,11 @@
* addresses in the source address
* selection */
VNET_DECLARE(bool, ip6_use_stableaddr); /* Whether to use stable address generation (RFC 7217) */
+VNET_DECLARE(bool, ip6_use_optimistic); /* Whether to use optimistic DAD (RFC 4429) */
#define V_ip6_use_tempaddr VNET(ip6_use_tempaddr)
#define V_ip6_prefer_tempaddr VNET(ip6_prefer_tempaddr)
#define V_ip6_use_stableaddr VNET(ip6_use_stableaddr)
+#define V_ip6_use_optimistic VNET(ip6_use_optimistic)
#define IP6_IDGEN_RETRIES 3 /* RFC 7217 section 7 default max retries */
VNET_DECLARE(u_int, ip6_stableaddr_maxretries);
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1026,11 +1026,11 @@
goto addrloop;
}
}
- } else if ((ia6->ia6_flags & IN6_IFF_TENTATIVE) != 0) {
+ } else if ((ia6->ia6_flags & IN6_IFF_NEED_DAD) != 0) {
/*
- * Schedule DAD for a tentative address. This happens
- * if the interface was down or not running
- * when the address was configured.
+ * Schedule DAD for a tentative or optimistic address.
+ * This happens if the interface was down or not
+ * running when the address was configured.
*/
int delay;
@@ -1040,7 +1040,8 @@
} else {
/*
* Check status of the interface. If it is down,
- * mark the address as tentative for future DAD.
+ * mark the address as optimistic if available, or
+ * mark it as tentative for future DAD.
*/
ifp = ia6->ia_ifp;
if ((ifp->if_inet6->nd_flags & ND6_IFF_NO_DAD) == 0 &&
@@ -1048,7 +1049,7 @@
(ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
(ifp->if_inet6->nd_flags & ND6_IFF_IFDISABLED))){
ia6->ia6_flags &= ~IN6_IFF_DUPLICATED;
- ia6->ia6_flags |= IN6_IFF_TENTATIVE;
+ in6_ifa_need_dad(ia6);
}
/*
@@ -1764,7 +1765,7 @@
AF_INET6)
continue;
ia = (struct in6_ifaddr *)ifa;
- ia->ia6_flags |= IN6_IFF_TENTATIVE;
+ in6_ifa_need_dad(ia);
}
NET_EPOCH_EXIT(et);
}
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -154,6 +154,7 @@
int rflag, tentative, tlladdr;
u_int lladdr_pad, lladdrlen;
uint32_t dflags;
+ bool optimistic;
ifa = NULL;
@@ -296,6 +297,7 @@
dflags |= ND6_QUEUE_FLAG_ANYCAST;
myaddr6 = *IFA_IN6(ifa);
tentative = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE;
+ optimistic = ((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_OPTIMISTIC;
if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_DUPLICATED)
goto freeit;
@@ -315,7 +317,7 @@
/*
* We have neighbor solicitation packet, with target address equals to
- * one of my tentative address.
+ * one of my tentative/optimistic address.
*
* src addr how to process?
* --- ---
@@ -325,27 +327,30 @@
*
* The processing is defined in RFC 2462.
*/
- if (tentative) {
+ if (tentative || optimistic) {
/*
* If source address is unspecified address, it is for
* duplicate address detection.
*
* If not, the packet is for addess resolution;
+ * Therefore, if the target address is not optimistic,
* silently ignore it.
*/
- if (IN6_IS_ADDR_UNSPECIFIED(&saddr6))
+ if (IN6_IS_ADDR_UNSPECIFIED(&saddr6)) {
nd6_dad_ns_input(ifa, ndopts.nd_opts_nonce);
-
- goto freeit;
+ goto freeit;
+ }
+ if (tentative)
+ goto freeit;
}
/*
- * If the Target Address is either an anycast address or a unicast
- * address for which the node is providing proxy service, or the Target
- * Link-Layer Address option is not included, the Override flag SHOULD
+ * If the Target Address is an anycast address, an optimistic address,
+ * or a unicast address for which the node is providing proxy service,
+ * or the Target LLA option is not included, the Override flag SHOULD
* be set to zero. Otherwise, the Override flag SHOULD be set to one.
*/
- if (dflags == 0 && (tlladdr & ND6_NA_OPT_LLA) != 0)
+ if (dflags == 0 && !optimistic && (tlladdr & ND6_NA_OPT_LLA) != 0)
rflag |= ND_NA_FLAG_OVERRIDE;
/*
* If the source address is unspecified address, entries must not
@@ -507,9 +512,16 @@
* We use the source address for the prompting packet
* (saddr6), if saddr6 belongs to the outgoing interface.
* Otherwise, we perform the source address selection as usual.
+ *
+ * RFC 4429 3.2: NS cannot be sent from Optimistic Addresses.
*/
if (saddr6 != NULL)
ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, saddr6);
+ if (ifa != NULL && (((struct in6_ifaddr *)ifa)->ia6_flags &
+ IN6_IFF_OPTIMISTIC) != 0) {
+ ifa_free(ifa);
+ ifa = NULL;
+ }
if (ifa == NULL) {
int error;
@@ -522,6 +534,20 @@
error));
goto bad;
}
+ ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &ip6->ip6_src);
+ if (ifa != NULL && (((struct in6_ifaddr *)ifa)->ia6_flags &
+ IN6_IFF_OPTIMISTIC) != 0) {
+ ifa_free(ifa);
+ ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp,
+ IN6_IFF_NOTREADY | IN6_IFF_ANYCAST | IN6_IFF_OPTIMISTIC);
+ if (ifa == NULL) {
+ nd6log((LOG_DEBUG, "%s: no non-optimistic "
+ "source address: dst=%s\n", __func__,
+ ip6_sprintf(ip6buf, &ip6->ip6_dst)));
+ goto bad;
+ }
+ ip6->ip6_src = *IFA_IN6(ifa);
+ }
} else
ip6->ip6_src = *saddr6;
@@ -772,14 +798,14 @@
/*
* Target address matches one of my interface address.
*
- * If my address is tentative, this means that there's somebody
+ * If my address is tentative/optimistic, means that there's somebody
* already using the same address as mine. This indicates DAD failure.
* This is defined in RFC 2462.
*
* Otherwise, process as defined in RFC 2461.
*/
if (ifa
- && (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_TENTATIVE)) {
+ && (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_NEED_DAD)) {
nd6_dad_na_input(ifa);
ifa_free(ifa);
goto freeit;
@@ -1308,7 +1334,7 @@
struct dadq *dp;
char ip6buf[INET6_ADDRSTRLEN];
- KASSERT((ia->ia6_flags & IN6_IFF_TENTATIVE) != 0,
+ KASSERT((ia->ia6_flags & IN6_IFF_NEED_DAD) != 0,
("starting DAD on non-tentative address %p", ifa));
/*
@@ -1320,7 +1346,7 @@
if ((ia->ia6_flags & IN6_IFF_ANYCAST) != 0 ||
V_ip6_dad_count == 0 ||
(ifa->ifa_ifp->if_inet6->nd_flags & ND6_IFF_NO_DAD) != 0) {
- ia->ia6_flags &= ~IN6_IFF_TENTATIVE;
+ ia->ia6_flags &= ~IN6_IFF_NEED_DAD;
return;
}
if ((ifa->ifa_ifp->if_flags & IFF_UP) == 0 ||
@@ -1428,7 +1454,7 @@
ifa->ifa_ifp ? if_name(ifa->ifa_ifp) : "???");
goto err;
}
- if ((ia->ia6_flags & IN6_IFF_TENTATIVE) == 0) {
+ if ((ia->ia6_flags & IN6_IFF_NEED_DAD) == 0) {
log(LOG_ERR, "nd6_dad_timer: called with non-tentative address "
"%s(%s)\n",
ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr),
@@ -1497,7 +1523,7 @@
* Reset DAD failures counter if using stable addresses.
*/
if ((ifp->if_inet6->nd_flags & ND6_IFF_IFDISABLED) == 0) {
- ia->ia6_flags &= ~IN6_IFF_TENTATIVE;
+ ia->ia6_flags &= ~IN6_IFF_NEED_DAD;
if ((ifp->if_inet6->nd_flags & ND6_IFF_STABLEADDR) && !(ia->ia6_flags & IN6_IFF_TEMPORARY))
atomic_store_int(&DAD_FAILURES(ifp), 0);
/*
@@ -1543,7 +1569,7 @@
dp->dad_ns_icount, dp->dad_ns_ocount, dp->dad_ns_lcount,
dp->dad_na_icount);
- ia->ia6_flags &= ~IN6_IFF_TENTATIVE;
+ ia->ia6_flags &= ~IN6_IFF_NEED_DAD;
ia->ia6_flags |= IN6_IFF_DUPLICATED;
log(LOG_ERR, "%s: DAD complete for %s - duplicate found\n",
@@ -1723,11 +1749,6 @@
* then the Override flag SHOULD NOT be set.
*/
if ((ndq->ndq_flags & ND6_QUEUE_FLAG_NEWGUA) != 0) {
- /*
- * XXX: If the address is in the Optimistic state,
- * then the Override flag MUST NOT be set.
- * We don't support RFC 4429 yet.
- */
if ((ifp->if_inet6->nd_flags & ND6_IFF_PREFER_SOURCE) == 0)
flags |= ND_NA_FLAG_OVERRIDE;
}
@@ -1737,6 +1758,12 @@
*/
if ((ndq->ndq_flags & ND6_QUEUE_FLAG_LLADDR) != 0)
flags |= ND_NA_FLAG_OVERRIDE;
+ /*
+ * RFC 9131 Section 6.1.2 and RFC 4429 Section 2.2: If the address
+ * is in the Optimistic state, then the Override flag MUST NOT be set.
+ */
+ if ((((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_OPTIMISTIC) != 0)
+ flags &= ~ND_NA_FLAG_OVERRIDE;
/* anycast advertisement delay rule (RFC 4861 7.2.7, SHOULD) */
if ((ndq->ndq_flags & ND6_QUEUE_FLAG_ANYCAST) != 0)
flags |= ND_NA_FLAG_SOLICITED;
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -108,6 +108,7 @@
VNET_DEFINE(int, ip6_use_tempaddr) = 0;
VNET_DEFINE(bool, ip6_use_stableaddr) = 1;
+VNET_DEFINE(bool, ip6_use_optimistic) = 1;
VNET_DEFINE(int, ip6_desync_factor);
VNET_DEFINE(uint32_t, ip6_temp_max_desync_factor) = TEMP_MAX_DESYNC_FACTOR_BASE;
@@ -1985,7 +1986,7 @@
if (find_pfxlist_reachable_router(ifa->ia6_ndpr)) {
if (ifa->ia6_flags & IN6_IFF_DETACHED) {
ifa->ia6_flags &= ~IN6_IFF_DETACHED;
- ifa->ia6_flags |= IN6_IFF_TENTATIVE;
+ in6_ifa_need_dad(ifa);
nd6_dad_start((struct ifaddr *)ifa, 0);
}
} else {
@@ -1999,7 +2000,7 @@
if (ifa->ia6_flags & IN6_IFF_DETACHED) {
ifa->ia6_flags &= ~IN6_IFF_DETACHED;
- ifa->ia6_flags |= IN6_IFF_TENTATIVE;
+ in6_ifa_need_dad(ifa);
/* Do we need a delay in this case? */
nd6_dad_start((struct ifaddr *)ifa, 0);
}
diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c
--- a/sys/netlink/route/iface.c
+++ b/sys/netlink/route/iface.c
@@ -1508,6 +1508,8 @@
nl_flags |= IFA_F_DEPRECATED;
if (flags & IN6_IFF_TENTATIVE)
nl_flags |= IFA_F_TENTATIVE;
+ if (flags & IN6_IFF_OPTIMISTIC)
+ nl_flags |= IFA_F_OPTIMISTIC;
if ((flags & (IN6_IFF_AUTOCONF|IN6_IFF_TEMPORARY)) == 0)
flags |= IFA_F_PERMANENT;
if (flags & IN6_IFF_DUPLICATED)
@@ -1528,6 +1530,8 @@
in6_flags |= IN6_IFF_DEPRECATED;
if (flags & IFA_F_TENTATIVE)
in6_flags |= IN6_IFF_TENTATIVE;
+ if (flags & IFA_F_OPTIMISTIC)
+ in6_flags |= IN6_IFF_OPTIMISTIC;
if (flags & IFA_F_DADFAILED)
in6_flags |= IN6_IFF_DUPLICATED;
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -163,6 +163,7 @@
close(s);
if (cap_llflags_get(capllflags, name, &llflag) != 0) {
+ /* XXX: RFC 4429 section 2.4: don't try with optimistic address */
warnmsg(LOG_WARNING, __func__,
"cap_llflags_get() failed, anyway I'll try");
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 5, 8:53 AM (22 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42225947
Default Alt Text
D55229.1796460826.diff (18 KB)
Attached To
Mode
D55229: nd6: Add support for Optimistic DAD (RFC 4429)
Attached
Detach File
Event Timeline