Skip to contentSkip to conversation

net: ipv6: Add a sysctl to make optimistic addresses useful candidates

RFC PATCH In review Erik Kline 2 participants 2 messages Oct 23, 2014

Subsystems (4)
lore
Share & tools
lore

Erik Kline

author
#0 lore raw

RFC PATCH v3 1/1 net: ipv6: Add a sysctl to make optimistic addresses useful candidates

Add a sysctl that causes an interface's optimistic addresses to be considered equivalent to other non-deprecated addresses for source address selection purposes. Preferred addresses will still take precedence over optimistic addresses, subject to other ranking in the source address selection algorithm.

This is useful where different interfaces are connected to different networks from different ISPs (e.g., a cell network and a home wifi network).

The current behaviour complies with RFC 3484/6724, and it makes sense if the host has only one interface, or has multiple interfaces on the same network (same or cooperating administrative domain(s), but not in the multiple distinct networks case.

For example, if a mobile device has an IPv6 address on an LTE network and then connects to IPv6-enabled wifi, while the wifi IPv6 address is undergoing DAD, IPv6 connections will try use the wifi default route with the LTE IPv6 address, and will get stuck until they time out.

Also, because optimistic nodes can receive frames, issue an RTM_NEWADDR as soon as DAD starts. If DAD fails, a separate RTM_DELADDR is always sent.

Also: add an entry in ip-sysctl.txt for optimistic_dad.

---
 Documentation/networking/ip-sysctl.txt | 13 +++++++++
 include/linux/ipv6.h                   |  1 +
 include/uapi/linux/ipv6.h              |  1 +
 net/ipv6/addrconf.c                    | 52 ++++++++++++++++++++++++++++++++--
 4 files changed, 64 insertions(+), 3 deletions(-)
Documentation/networking/ip-sysctl.txt +13 -0
index 0307e28..e03cf49 100644
@@ -1452,6 +1452,19 @@ suppress_frag_ndisc - INTEGER
 	1 - (default) discard fragmented neighbor discovery packets
 	0 - allow fragmented neighbor discovery packets
 
+optimistic_dad - BOOLEAN
+	Whether to perform Optimistic Duplicate Address Detection (RFC 4429).
+		0: disabled (default)
+		1: enabled
+
+use_optimistic - BOOLEAN
+	If enabled, do not classify optimistic addresses as deprecated during
+	source address selection.  Preferred addresses will still be chosen
+	before optimistic addresses, subject to other ranking in the source
+	address selection algorithm.
+		0: disabled (default)
+		1: enabled
+
 icmp/*:
 ratelimit - INTEGER
 	Limit the maximal rates for sending ICMPv6 packets.
include/linux/ipv6.h +1 -0
index ff56053..7121a2e 100644
@@ -42,6 +42,7 @@ struct ipv6_devconf {
 	__s32		accept_ra_from_local;
 #ifdef CONFIG_IPV6_OPTIMISTIC_DAD
 	__s32		optimistic_dad;
+	__s32		use_optimistic;
 #endif
 #ifdef CONFIG_IPV6_MROUTE
 	__s32		mc_forwarding;
include/uapi/linux/ipv6.h +1 -0
index efa2666..e863d08 100644
@@ -164,6 +164,7 @@ enum {
 	DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
 	DEVCONF_SUPPRESS_FRAG_NDISC,
 	DEVCONF_ACCEPT_RA_FROM_LOCAL,
+	DEVCONF_USE_OPTIMISTIC,
 	DEVCONF_MAX
 };
 
net/ipv6/addrconf.c +49 -3

104 lines not on this page · raw message

Signature · 1 line
2.1.0.rc2.206.gedb03e5
#1 lore raw
Quoted 22 lines · Erik Kline

Add a sysctl that causes an interface's optimistic addresses to be considered equivalent to other non-deprecated addresses for source address selection purposes. Preferred addresses will still take precedence over optimistic addresses, subject to other ranking in the source address selection algorithm.

This is useful where different interfaces are connected to different networks from different ISPs (e.g., a cell network and a home wifi network).

The current behaviour complies with RFC 3484/6724, and it makes sense if the host has only one interface, or has multiple interfaces on the same network (same or cooperating administrative domain(s), but not in the multiple distinct networks case.

For example, if a mobile device has an IPv6 address on an LTE network and then connects to IPv6-enabled wifi, while the wifi IPv6 address is undergoing DAD, IPv6 connections will try use the wifi default route with the LTE IPv6 address, and will get stuck until they time out.

Quoted 7 lines

Also, because optimistic nodes can receive frames, issue an RTM_NEWADDR as soon as DAD starts. If DAD fails, a separate RTM_DELADDR is always sent.

Also: add an entry in ip-sysctl.txt for optimistic_dad.

I agree with the principle of the patch. This option is useful.

Thank you,
Nicolas