Message ID | 1474797596-13320-1-git-send-email-zenczykowski@gmail.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
This is missing an appropriate "[PATCH v2 0/7] ..." cover letter that explains at a high level what this patch series is doing, why it is doing it, and how it is doing it. You'll have to submit a v3 with this fixed.
Hi, This patch series implements RFC7559 style backoff of IPv6 router solicitation requests. Patches 1 and 2 are minor cleanup and stand on their own. Patch 3 allows a (potentially) infinite number of RS'es to be sent when the rtr_solicits sysctl is set to -1 (this depends on patch 1). Patch 4 is just boilerplate to add a new sysctl for the maximum backoff period. Patch 5 implements the backoff algorithm (and depends on the previous patches). Patches 6 and 7 switch the defaults over to enable this by default. [PATCH v3 1/7] ipv6 addrconf: enable use of proc_dointvec_minmax in [PATCH v3 2/7] ipv6 addrconf: remove addrconf_sysctl_hop_limit() [PATCH v3 3/7] ipv6 addrconf: rtr_solicits == -1 means unlimited [PATCH v3 4/7] ipv6 addrconf: add new sysctl [PATCH v3 5/7] ipv6 addrconf: implement RFC7559 router solicitation [PATCH v3 6/7] ipv6 addrconf: change default [PATCH v3 7/7] ipv6 addrconf: change default MAX_RTR_SOLICITATIONS Changes v2->v3: none Changes v1->v2: avoid 64-bit divisions to fix 32-bit build errors
Hi, This patch series implements RFC7559 style backoff of IPv6 router solicitation requests. Patches 1 and 2 are minor cleanup and stand on their own. Patch 3 allows a (potentially) infinite number of RS'es to be sent when the rtr_solicits sysctl is set to -1 (this depends on patch 1). Patch 4 is just boilerplate to add a new sysctl for the maximum backoff period. Patch 5 implements the backoff algorithm (and depends on the previous patches). Patches 6 and 7 switch the defaults over to enable this by default. [PATCH v4 1/7] ipv6 addrconf: enable use of proc_dointvec_minmax in [PATCH v4 2/7] ipv6 addrconf: remove addrconf_sysctl_hop_limit() [PATCH v4 3/7] ipv6 addrconf: rtr_solicits == -1 means unlimited [PATCH v4 4/7] ipv6 addrconf: add new sysctl [PATCH v4 5/7] ipv6 addrconf: implement RFC7559 router solicitation [PATCH v4 6/7] ipv6 addrconf: change default [PATCH v4 7/7] ipv6 addrconf: change default MAX_RTR_SOLICITATIONS Changes v3->v4: added subject line to cover letter Changes v2->v3: added cover letter Changes v1->v2: avoid 64-bit divisions to fix 32-bit build errors
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 2f1f5d439788..11fa1a5564d4 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -6044,8 +6044,14 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name, for (i = 0; table[i].data; i++) { table[i].data += (char *)p - (char *)&ipv6_devconf; - table[i].extra1 = idev; /* embedded; no ref */ - table[i].extra2 = net; + /* If one of these is already set, then it is not safe to + * overwrite either of them: this makes proc_dointvec_minmax + * usable. + */ + if (!table[i].extra1 && !table[i].extra2) { + table[i].extra1 = idev; /* embedded; no ref */ + table[i].extra2 = net; + } } snprintf(path, sizeof(path), "net/ipv6/conf/%s", dev_name);