* [PATCH net] ipv6: set all.accept_dad to 0 by default
@ 2017-11-13 13:45 Nicolas Dichtel
2017-11-13 14:21 ` Erik Kline
2017-11-14 2:24 ` Stefano Brivio
0 siblings, 2 replies; 18+ messages in thread
From: Nicolas Dichtel @ 2017-11-13 13:45 UTC (permalink / raw)
To: davem; +Cc: netdev, Nicolas Dichtel, Stefano Brivio, Matteo Croce, Erik Kline
The commit a2d3f3e33853 modifies the way to disable dad on an interface.
Before the patch, setting <iface>.accept_dad to 0 was enough to disable it.
Because all.accept_dad is set to 1 by default, after the patch, the user
needs to set both all.accept_dad and <iface>.accept_dad to 0 to disable it.
This is not backward compatible. When a user updates its kernel, the dad
may be enabled by error.
Let's set all.accept_dad to 0 by default to restore the previous behavior.
Fixes: a2d3f3e33853 ("ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real")
CC: Stefano Brivio <sbrivio@redhat.com>
CC: Matteo Croce <mcroce@redhat.com>
CC: Erik Kline <ek@google.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
net/ipv6/addrconf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8a1c846d3df9..ef5b61507b9a 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -231,7 +231,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
.proxy_ndp = 0,
.accept_source_route = 0, /* we do not accept RH0 by default. */
.disable_ipv6 = 0,
- .accept_dad = 1,
+ .accept_dad = 0,
.suppress_frag_ndisc = 1,
.accept_ra_mtu = 1,
.stable_secret = {
--
2.13.2
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 13:45 [PATCH net] ipv6: set all.accept_dad to 0 by default Nicolas Dichtel @ 2017-11-13 14:21 ` Erik Kline 2017-11-13 14:28 ` Matteo Croce ` (2 more replies) 2017-11-14 2:24 ` Stefano Brivio 1 sibling, 3 replies; 18+ messages in thread From: Erik Kline @ 2017-11-13 14:21 UTC (permalink / raw) To: Nicolas Dichtel Cc: David Miller, netdev, Stefano Brivio, Matteo Croce, Maciej Żenczykowski [-- Attachment #1: Type: text/plain, Size: 1855 bytes --] Should we consider rolling back the patch that caused this? "accept_dad = 1" is the proper IETF-expected default behaviour. Alternatively, if we really want to make all, default, and ifname useful perhaps we need to investigate a tristate option (for currently boolean values, at least). -1 could mean no preference, for example. On 13 November 2017 at 13:45, Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote: > The commit a2d3f3e33853 modifies the way to disable dad on an interface. > Before the patch, setting <iface>.accept_dad to 0 was enough to disable it. > Because all.accept_dad is set to 1 by default, after the patch, the user > needs to set both all.accept_dad and <iface>.accept_dad to 0 to disable it. > > This is not backward compatible. When a user updates its kernel, the dad > may be enabled by error. > > Let's set all.accept_dad to 0 by default to restore the previous behavior. > > Fixes: a2d3f3e33853 ("ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real") > CC: Stefano Brivio <sbrivio@redhat.com> > CC: Matteo Croce <mcroce@redhat.com> > CC: Erik Kline <ek@google.com> > Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> > --- > net/ipv6/addrconf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c > index 8a1c846d3df9..ef5b61507b9a 100644 > --- a/net/ipv6/addrconf.c > +++ b/net/ipv6/addrconf.c > @@ -231,7 +231,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = { > .proxy_ndp = 0, > .accept_source_route = 0, /* we do not accept RH0 by default. */ > .disable_ipv6 = 0, > - .accept_dad = 1, > + .accept_dad = 0, > .suppress_frag_ndisc = 1, > .accept_ra_mtu = 1, > .stable_secret = { > -- > 2.13.2 > [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/pkcs7-signature, Size: 4835 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 14:21 ` Erik Kline @ 2017-11-13 14:28 ` Matteo Croce 2017-11-13 14:32 ` Stefano Brivio 2017-11-14 2:42 ` Stefano Brivio 2 siblings, 0 replies; 18+ messages in thread From: Matteo Croce @ 2017-11-13 14:28 UTC (permalink / raw) To: Erik Kline Cc: Nicolas Dichtel, David Miller, netdev, Stefano Brivio, Maciej Żenczykowski On Mon, Nov 13, 2017 at 3:21 PM, Erik Kline <ek@google.com> wrote: > Should we consider rolling back the patch that caused this? > "accept_dad = 1" is the proper IETF-expected default behaviour. > > Alternatively, if we really want to make all, default, and ifname > useful perhaps we need to investigate a tristate option (for currently > boolean values, at least). -1 could mean no preference, for example. > > On 13 November 2017 at 13:45, Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote: >> The commit a2d3f3e33853 modifies the way to disable dad on an interface. >> Before the patch, setting <iface>.accept_dad to 0 was enough to disable it. >> Because all.accept_dad is set to 1 by default, after the patch, the user >> needs to set both all.accept_dad and <iface>.accept_dad to 0 to disable it. >> >> This is not backward compatible. When a user updates its kernel, the dad >> may be enabled by error. >> >> Let's set all.accept_dad to 0 by default to restore the previous behavior. >> >> Fixes: a2d3f3e33853 ("ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real") >> CC: Stefano Brivio <sbrivio@redhat.com> >> CC: Matteo Croce <mcroce@redhat.com> >> CC: Erik Kline <ek@google.com> >> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> >> --- >> net/ipv6/addrconf.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c >> index 8a1c846d3df9..ef5b61507b9a 100644 >> --- a/net/ipv6/addrconf.c >> +++ b/net/ipv6/addrconf.c >> @@ -231,7 +231,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = { >> .proxy_ndp = 0, >> .accept_source_route = 0, /* we do not accept RH0 by default. */ >> .disable_ipv6 = 0, >> - .accept_dad = 1, >> + .accept_dad = 0, >> .suppress_frag_ndisc = 1, >> .accept_ra_mtu = 1, >> .stable_secret = { >> -- >> 2.13.2 >> Another way could be putting the "all" and per interface handlers in logical AND. The fact is before the patch, the "all" handler really was a noop. What do you think? -- Matteo Croce per aspera ad upstream ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 14:21 ` Erik Kline 2017-11-13 14:28 ` Matteo Croce @ 2017-11-13 14:32 ` Stefano Brivio 2017-11-13 14:52 ` Maciej Żenczykowski 2017-11-14 2:42 ` Stefano Brivio 2 siblings, 1 reply; 18+ messages in thread From: Stefano Brivio @ 2017-11-13 14:32 UTC (permalink / raw) To: Erik Kline Cc: Nicolas Dichtel, David Miller, netdev, Matteo Croce, Maciej Żenczykowski On Mon, 13 Nov 2017 14:21:52 +0000 Erik Kline <ek@google.com> wrote: > Should we consider rolling back the patch that caused this? > "accept_dad = 1" is the proper IETF-expected default behaviour. > > Alternatively, if we really want to make all, default, and ifname > useful perhaps we need to investigate a tristate option (for currently > boolean values, at least). -1 could mean no preference, for example. I haven't checked how ugly it would be, yet. But another way to restore the previous behaviour, while keeping the new functionality, would be to keep the global default as 1 and instead set the per-interface accept_dad default value to 0. What do you think? -- Stefano ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 14:32 ` Stefano Brivio @ 2017-11-13 14:52 ` Maciej Żenczykowski 2017-11-13 15:05 ` Stefano Brivio 0 siblings, 1 reply; 18+ messages in thread From: Maciej Żenczykowski @ 2017-11-13 14:52 UTC (permalink / raw) To: Stefano Brivio Cc: Erik Kline, Nicolas Dichtel, David Miller, netdev, Matteo Croce >> Should we consider rolling back the patch that caused this? >> "accept_dad = 1" is the proper IETF-expected default behaviour. >> >> Alternatively, if we really want to make all, default, and ifname >> useful perhaps we need to investigate a tristate option (for currently >> boolean values, at least). -1 could mean no preference, for example. > > I haven't checked how ugly it would be, yet. But another way to restore > the previous behaviour, while keeping the new functionality, would be > to keep the global default as 1 and instead set the per-interface > accept_dad default value to 0. What do you think? The default out-of-the-box behaviour should definitely be to do DAD. You can achieve this in 4 ways: [A] all=1, default=1, AND --> the OLD pre-patch behaviour [B] all=1, default=1, OR --> the NEW post-patch behaviour - problematic [C] all=1, default=0, OR --> problematic for same reason: iface=0 is a no-op [D] all=0, default=1, OR Note that: AND == (all < 1 || interface < 1) OR == (all < 1 && interface < 1) [C] requires one to set all but one interface (incl. default) to 1, then set all=0, just to disable a single interface's dad [D] is weird, because with the default already being dad enabled, there's really no reason to ever set all=1 Being able to disable either for all interfaces (via all=0) or for a specific interface (via iface=0) seems the most useful. Setting all=1, default=0, specific_interfaces=1, AND-logic also seems useful. Hence my vote to rollback a2d3f3e33853. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 14:52 ` Maciej Żenczykowski @ 2017-11-13 15:05 ` Stefano Brivio 2017-11-13 16:09 ` Nicolas Dichtel 0 siblings, 1 reply; 18+ messages in thread From: Stefano Brivio @ 2017-11-13 15:05 UTC (permalink / raw) To: Maciej Żenczykowski Cc: Erik Kline, Nicolas Dichtel, David Miller, netdev, Matteo Croce On Mon, 13 Nov 2017 23:52:26 +0900 Maciej Żenczykowski <maze@google.com> wrote: > >> Should we consider rolling back the patch that caused this? > >> "accept_dad = 1" is the proper IETF-expected default behaviour. > >> > >> Alternatively, if we really want to make all, default, and ifname > >> useful perhaps we need to investigate a tristate option (for currently > >> boolean values, at least). -1 could mean no preference, for example. > > > > I haven't checked how ugly it would be, yet. But another way to restore > > the previous behaviour, while keeping the new functionality, would be > > to keep the global default as 1 and instead set the per-interface > > accept_dad default value to 0. What do you think? > > The default out-of-the-box behaviour should definitely be to do DAD. > > You can achieve this in 4 ways: > > [A] all=1, default=1, AND --> the OLD pre-patch behaviour Old pre-patch behaviour simply ignored the 'all' value though. > [B] all=1, default=1, OR --> the NEW post-patch behaviour - problematic > [C] all=1, default=0, OR --> problematic for same reason: iface=0 is a no-op But this way you could still globally disable DAD, starting from default values, by simply setting 'all' to zero, which is what Nicolas wanted. > [D] all=0, default=1, OR > > Note that: > AND == (all < 1 || interface < 1) > OR == (all < 1 && interface < 1) > > [C] requires one to set all but one interface (incl. default) to 1, > then set all=0, > just to disable a single interface's dad > > [D] is weird, because with the default already being dad enabled, there's really > no reason to ever set all=1 > > Being able to disable either for all interfaces (via all=0) or for a > specific interface (via iface=0) seems > the most useful. > > Setting all=1, default=0, specific_interfaces=1, AND-logic also seems useful. > > Hence my vote to rollback a2d3f3e33853. We're mostly talking about 35e015e1f577 here. -- Stefano ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 15:05 ` Stefano Brivio @ 2017-11-13 16:09 ` Nicolas Dichtel 0 siblings, 0 replies; 18+ messages in thread From: Nicolas Dichtel @ 2017-11-13 16:09 UTC (permalink / raw) To: Stefano Brivio, Maciej Żenczykowski Cc: Erik Kline, David Miller, netdev, Matteo Croce Le 13/11/2017 à 16:05, Stefano Brivio a écrit : > On Mon, 13 Nov 2017 23:52:26 +0900 > Maciej Żenczykowski <maze@google.com> wrote: > >>>> Should we consider rolling back the patch that caused this? >>>> "accept_dad = 1" is the proper IETF-expected default behaviour. >>>> >>>> Alternatively, if we really want to make all, default, and ifname >>>> useful perhaps we need to investigate a tristate option (for currently >>>> boolean values, at least). -1 could mean no preference, for example. >>> >>> I haven't checked how ugly it would be, yet. But another way to restore >>> the previous behaviour, while keeping the new functionality, would be >>> to keep the global default as 1 and instead set the per-interface >>> accept_dad default value to 0. What do you think? >> >> The default out-of-the-box behaviour should definitely be to do DAD. Yes, and my patch didn't modify this. >> >> You can achieve this in 4 ways: >> >> [A] all=1, default=1, AND --> the OLD pre-patch behaviour > > Old pre-patch behaviour simply ignored the 'all' value though. > >> [B] all=1, default=1, OR --> the NEW post-patch behaviour - problematic >> [C] all=1, default=0, OR --> problematic for same reason: iface=0 is a no-op > > But this way you could still globally disable DAD, starting from > default values, by simply setting 'all' to zero, which is what Nicolas > wanted. > >> [D] all=0, default=1, OR >> >> Note that: >> AND == (all < 1 || interface < 1) >> OR == (all < 1 && interface < 1) >> >> [C] requires one to set all but one interface (incl. default) to 1, >> then set all=0, >> just to disable a single interface's dad >> >> [D] is weird, because with the default already being dad enabled, there's really >> no reason to ever set all=1 >> >> Being able to disable either for all interfaces (via all=0) or for a >> specific interface (via iface=0) seems >> the most useful. >> >> Setting all=1, default=0, specific_interfaces=1, AND-logic also seems useful. >> >> Hence my vote to rollback a2d3f3e33853. > > We're mostly talking about 35e015e1f577 here. > I don't have a strong opinion about what to do. My reasoning was that before patch 35e015e1f577, all.accept_dad had no effect, thus I took the assumption that users didn't modify it, but only default.accept_dad and <iface>.accept_dad. With this assumption, my patch helps to keep the same settings when upgrading the kernel. Nicolas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 14:21 ` Erik Kline 2017-11-13 14:28 ` Matteo Croce 2017-11-13 14:32 ` Stefano Brivio @ 2017-11-14 2:42 ` Stefano Brivio 2 siblings, 0 replies; 18+ messages in thread From: Stefano Brivio @ 2017-11-14 2:42 UTC (permalink / raw) To: Erik Kline Cc: Nicolas Dichtel, David Miller, netdev, Matteo Croce, Maciej Żenczykowski On Mon, 13 Nov 2017 14:21:52 +0000 Erik Kline <ek@google.com> wrote: > Alternatively, if we really want to make all, default, and ifname > useful perhaps we need to investigate a tristate option (for currently > boolean values, at least). -1 could mean no preference, for example. I think this would make sense in general, but on the other hand it would be quite a big change, and Nicolas' patch has the advantages of being small, keeping the global flag functional, and restoring the previous default behaviour out of the box when 'accept_dad' is disabled by the user for a given interface. Besides, this still wouldn't solve the case where flags are >= 0 and conflicting -- there, it's still debatable whether we want a logical OR or a logical AND. In the end, I would prefer either Nicolas' patch, or to get rid of the global 'accept_dad' flag altogether. Having a flag which does absolutely nothing, which was the case before 35e015e1f577, doesn't sound correct by any means. -- Stefano ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-13 13:45 [PATCH net] ipv6: set all.accept_dad to 0 by default Nicolas Dichtel 2017-11-13 14:21 ` Erik Kline @ 2017-11-14 2:24 ` Stefano Brivio 2017-11-14 9:43 ` Nicolas Dichtel 2017-11-14 13:21 ` [PATCH net v2] " Nicolas Dichtel 1 sibling, 2 replies; 18+ messages in thread From: Stefano Brivio @ 2017-11-14 2:24 UTC (permalink / raw) To: Nicolas Dichtel; +Cc: davem, netdev, Matteo Croce, Erik Kline On Mon, 13 Nov 2017 14:45:36 +0100 Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote: > The commit a2d3f3e33853 modifies the way to disable dad on an interface. > Before the patch, setting <iface>.accept_dad to 0 was enough to disable it. > Because all.accept_dad is set to 1 by default, after the patch, the user > needs to set both all.accept_dad and <iface>.accept_dad to 0 to disable it. Perhaps it would make sense to be a bit more descriptive here, this seems to have generated quite some confusion. Besides, a2d3f3e33853 was just a fix-up for 35e015e1f577, which is instead the change which actually changed the behaviour. What about: --- With commit 35e015e1f577 ("ipv6: fix net.ipv6.conf.all interface DAD handlers"), the global 'accept_dad' flag is also taken into account and set to 1 by default. If either global or per-interface flag is non-zero, DAD will be enabled on a given interface. This is not backward compatible: before 35e015e1f577, the user could disable DAD just by setting the per-interface flag to 0. Now, the user instead needs to set both flags to 0 to actually disable DAD. Restore the previous behaviour by setting the default for the global 'accept_dad' flag to 0. This way, DAD is still enabled by default, as per-interface flags are set to 1 on device creation, but setting them to 0 is enough to disable DAD on a given interface. - Before 35e015e1f577: global per-interface DAD enabled [default] 1 1 yes X 0 no X 1 yes - After 35e015e1f577: global per-interface DAD enabled 0 0 no 0 1 yes 1 0 yes [default] 1 1 yes - After this fix: global per-interface DAD enabled 0 0 no [default] 0 1 yes 1 0 yes 1 1 yes --- > Fixes: a2d3f3e33853 ("ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real") And I'd rather say: Fixes: 35e015e1f577 ("ipv6: fix net.ipv6.conf.all interface DAD handlers") > CC: Stefano Brivio <sbrivio@redhat.com> > CC: Matteo Croce <mcroce@redhat.com> > CC: Erik Kline <ek@google.com> > Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> With a more descriptive commit message and the appropriate Fixes: reference, FWIW, Acked-by: Stefano Brivio <sbrivio@redhat.com> -- Stefano ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net] ipv6: set all.accept_dad to 0 by default 2017-11-14 2:24 ` Stefano Brivio @ 2017-11-14 9:43 ` Nicolas Dichtel 2017-11-14 13:21 ` [PATCH net v2] " Nicolas Dichtel 1 sibling, 0 replies; 18+ messages in thread From: Nicolas Dichtel @ 2017-11-14 9:43 UTC (permalink / raw) To: Stefano Brivio; +Cc: davem, netdev, Matteo Croce, Erik Kline Le 14/11/2017 à 03:24, Stefano Brivio a écrit : > On Mon, 13 Nov 2017 14:45:36 +0100 > Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote: > >> The commit a2d3f3e33853 modifies the way to disable dad on an interface. >> Before the patch, setting <iface>.accept_dad to 0 was enough to disable it. >> Because all.accept_dad is set to 1 by default, after the patch, the user >> needs to set both all.accept_dad and <iface>.accept_dad to 0 to disable it. > > Perhaps it would make sense to be a bit more descriptive here, this > seems to have generated quite some confusion. Yes, I agree. I will send a v2. Thank you, Nicolas ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-14 2:24 ` Stefano Brivio 2017-11-14 9:43 ` Nicolas Dichtel @ 2017-11-14 13:21 ` Nicolas Dichtel 2017-11-14 13:53 ` Stefano Brivio ` (2 more replies) 1 sibling, 3 replies; 18+ messages in thread From: Nicolas Dichtel @ 2017-11-14 13:21 UTC (permalink / raw) To: davem; +Cc: netdev, Nicolas Dichtel, Stefano Brivio, Matteo Croce, Erik Kline With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag is also taken into account (default value is 1). If either global or per-interface flag is non-zero, DAD will be enabled on a given interface. This is not backward compatible: before those patches, the user could disable DAD just by setting the per-interface flag to 0. Now, the user instead needs to set both flags to 0 to actually disable DAD. Restore the previous behaviour by setting the default for the global 'accept_dad' flag to 0. This way, DAD is still enabled by default, as per-interface flags are set to 1 on device creation, but setting them to 0 is enough to disable DAD on a given interface. - Before 35e015e1f57a7 and a2d3f3e33853: global per-interface DAD enabled [default] 1 1 yes X 0 no X 1 yes - After 35e015e1f577 and a2d3f3e33853: global per-interface DAD enabled [default] 1 1 yes 0 0 no 0 1 yes 1 0 yes - After this fix: global per-interface DAD enabled 1 1 yes 0 0 no [default] 0 1 yes 1 0 yes Fixes: 35e015e1f577 ("ipv6: fix net.ipv6.conf.all interface DAD handlers") Fixes: a2d3f3e33853 ("ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real") CC: Stefano Brivio <sbrivio@redhat.com> CC: Matteo Croce <mcroce@redhat.com> CC: Erik Kline <ek@google.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> --- v1 -> v2: reword the commitlog Stefano, I've kept both 'Fixes' lines because technically, the behavior has changed with a2d3f3e33853, not with 35e015e1f577. net/ipv6/addrconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8a1c846d3df9..ef5b61507b9a 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -231,7 +231,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = { .proxy_ndp = 0, .accept_source_route = 0, /* we do not accept RH0 by default. */ .disable_ipv6 = 0, - .accept_dad = 1, + .accept_dad = 0, .suppress_frag_ndisc = 1, .accept_ra_mtu = 1, .stable_secret = { -- 2.15.0 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-14 13:21 ` [PATCH net v2] " Nicolas Dichtel @ 2017-11-14 13:53 ` Stefano Brivio 2017-11-14 18:30 ` Girish Moodalbail 2017-11-15 10:17 ` Nicolas Dichtel 2 siblings, 0 replies; 18+ messages in thread From: Stefano Brivio @ 2017-11-14 13:53 UTC (permalink / raw) To: Nicolas Dichtel; +Cc: davem, netdev, Matteo Croce, Erik Kline On Tue, 14 Nov 2017 14:21:32 +0100 Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote: > With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag > is also taken into account (default value is 1). If either global or > per-interface flag is non-zero, DAD will be enabled on a given interface. > > This is not backward compatible: before those patches, the user could > disable DAD just by setting the per-interface flag to 0. Now, the > user instead needs to set both flags to 0 to actually disable DAD. > > Restore the previous behaviour by setting the default for the global > 'accept_dad' flag to 0. This way, DAD is still enabled by default, > as per-interface flags are set to 1 on device creation, but setting > them to 0 is enough to disable DAD on a given interface. > > - Before 35e015e1f57a7 and a2d3f3e33853: > global per-interface DAD enabled > [default] 1 1 yes > X 0 no > X 1 yes > > - After 35e015e1f577 and a2d3f3e33853: > global per-interface DAD enabled > [default] 1 1 yes > 0 0 no > 0 1 yes > 1 0 yes > > - After this fix: > global per-interface DAD enabled > 1 1 yes > 0 0 no > [default] 0 1 yes > 1 0 yes > > Fixes: 35e015e1f577 ("ipv6: fix net.ipv6.conf.all interface DAD handlers") > Fixes: a2d3f3e33853 ("ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real") > CC: Stefano Brivio <sbrivio@redhat.com> > CC: Matteo Croce <mcroce@redhat.com> > CC: Erik Kline <ek@google.com> > Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Stefano Brivio <sbrivio@redhat.com> -- Stefano ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-14 13:21 ` [PATCH net v2] " Nicolas Dichtel 2017-11-14 13:53 ` Stefano Brivio @ 2017-11-14 18:30 ` Girish Moodalbail 2017-11-14 19:10 ` Stefano Brivio 2017-11-15 10:17 ` Nicolas Dichtel 2 siblings, 1 reply; 18+ messages in thread From: Girish Moodalbail @ 2017-11-14 18:30 UTC (permalink / raw) To: Nicolas Dichtel, davem; +Cc: netdev, Stefano Brivio, Matteo Croce, Erik Kline On 11/14/17 5:21 AM, Nicolas Dichtel wrote: > With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag > is also taken into account (default value is 1). If either global or > per-interface flag is non-zero, DAD will be enabled on a given interface. > > This is not backward compatible: before those patches, the user could > disable DAD just by setting the per-interface flag to 0. Now, the > user instead needs to set both flags to 0 to actually disable DAD. > > Restore the previous behaviour by setting the default for the global > 'accept_dad' flag to 0. This way, DAD is still enabled by default, > as per-interface flags are set to 1 on device creation, but setting > them to 0 is enough to disable DAD on a given interface. > > - Before 35e015e1f57a7 and a2d3f3e33853: > global per-interface DAD enabled > [default] 1 1 yes > X 0 no > X 1 yes > > - After 35e015e1f577 and a2d3f3e33853: > global per-interface DAD enabled > [default] 1 1 yes > 0 0 no > 0 1 yes > 1 0 yes > > - After this fix: > global per-interface DAD enabled > 1 1 yes > 0 0 no > [default] 0 1 yes > 1 0 yes Above table can be summarized to.. - After this fix: global per-interface DAD enabled 1 X yes 0 0 no [default] 0 1 yes So, if global is set to '1', then irrespective of what the per-interface value is DAD will be enabled. Is it not confusing. Shouldn't the more specific value override the general value? On the other hand, if the global is set to '0', then per-interface value will be honored (overrides global). So, the meaning of global varies based on its value. Isn't that confusing as well. thanks, ~Girish ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-14 18:30 ` Girish Moodalbail @ 2017-11-14 19:10 ` Stefano Brivio 2017-11-14 20:52 ` Girish Moodalbail 0 siblings, 1 reply; 18+ messages in thread From: Stefano Brivio @ 2017-11-14 19:10 UTC (permalink / raw) To: Girish Moodalbail Cc: Nicolas Dichtel, davem, netdev, Matteo Croce, Erik Kline On Tue, 14 Nov 2017 10:30:33 -0800 Girish Moodalbail <girish.moodalbail@oracle.com> wrote: > On 11/14/17 5:21 AM, Nicolas Dichtel wrote: > > With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag > > is also taken into account (default value is 1). If either global or > > per-interface flag is non-zero, DAD will be enabled on a given interface. > > > > This is not backward compatible: before those patches, the user could > > disable DAD just by setting the per-interface flag to 0. Now, the > > user instead needs to set both flags to 0 to actually disable DAD. > > > > Restore the previous behaviour by setting the default for the global > > 'accept_dad' flag to 0. This way, DAD is still enabled by default, > > as per-interface flags are set to 1 on device creation, but setting > > them to 0 is enough to disable DAD on a given interface. > > > > - Before 35e015e1f57a7 and a2d3f3e33853: > > global per-interface DAD enabled > > [default] 1 1 yes > > X 0 no > > X 1 yes > > > > - After 35e015e1f577 and a2d3f3e33853: > > global per-interface DAD enabled > > [default] 1 1 yes > > 0 0 no > > 0 1 yes > > 1 0 yes > > > > - After this fix: > > global per-interface DAD enabled > > 1 1 yes > > 0 0 no > > [default] 0 1 yes > > 1 0 yes > > Above table can be summarized to.. > > - After this fix: > global per-interface DAD enabled > 1 X yes > 0 0 no > [default] 0 1 yes > > So, if global is set to '1', then irrespective of what the per-interface value > is DAD will be enabled. Is it not confusing. Shouldn't the more specific value > override the general value? Might be a bit confusing, yes, but in order to implement an overriding mechanism you would need to implement a tristate option as Eric K. proposed. That is, by default you would have -1 (meaning "don't care") on per-interface flags, and if this value is changed then the per-interface value wins over the global one. Sensible, but I think it's outside of the scope of this patch, which is just intended to restore a specific pre-existing userspace expectation. > On the other hand, if the global is set to '0', then per-interface value will be > honored (overrides global). So, the meaning of global varies based on its value. > Isn't that confusing as well. I don't find this confusing though. Setting the global flag always has the meaning of "force enabling DAD on all interfaces". You would have the same problem if you chose a logical AND between global and per-interface flag. There, setting the global flag would mean "force disabling DAD on all interfaces". So the only indisputable improvement I see here would be to implement a "don't care" value (either for global or for per-interface flags). But I'd rather agree with Nicolas that we should fix a potentially broken userspace assumption first. -- Stefano ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-14 19:10 ` Stefano Brivio @ 2017-11-14 20:52 ` Girish Moodalbail 0 siblings, 0 replies; 18+ messages in thread From: Girish Moodalbail @ 2017-11-14 20:52 UTC (permalink / raw) To: Stefano Brivio; +Cc: Nicolas Dichtel, davem, netdev, Matteo Croce, Erik Kline On 11/14/17 11:10 AM, Stefano Brivio wrote: > On Tue, 14 Nov 2017 10:30:33 -0800 > Girish Moodalbail <girish.moodalbail@oracle.com> wrote: > >> On 11/14/17 5:21 AM, Nicolas Dichtel wrote: >>> With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag >>> is also taken into account (default value is 1). If either global or >>> per-interface flag is non-zero, DAD will be enabled on a given interface. >>> >>> This is not backward compatible: before those patches, the user could >>> disable DAD just by setting the per-interface flag to 0. Now, the >>> user instead needs to set both flags to 0 to actually disable DAD. >>> >>> Restore the previous behaviour by setting the default for the global >>> 'accept_dad' flag to 0. This way, DAD is still enabled by default, >>> as per-interface flags are set to 1 on device creation, but setting >>> them to 0 is enough to disable DAD on a given interface. >>> >>> - Before 35e015e1f57a7 and a2d3f3e33853: >>> global per-interface DAD enabled >>> [default] 1 1 yes >>> X 0 no >>> X 1 yes >>> >>> - After 35e015e1f577 and a2d3f3e33853: >>> global per-interface DAD enabled >>> [default] 1 1 yes >>> 0 0 no >>> 0 1 yes >>> 1 0 yes >>> >>> - After this fix: >>> global per-interface DAD enabled >>> 1 1 yes >>> 0 0 no >>> [default] 0 1 yes >>> 1 0 yes >> >> Above table can be summarized to.. >> >> - After this fix: >> global per-interface DAD enabled >> 1 X yes >> 0 0 no >> [default] 0 1 yes >> >> So, if global is set to '1', then irrespective of what the per-interface value >> is DAD will be enabled. Is it not confusing. Shouldn't the more specific value >> override the general value? > > Might be a bit confusing, yes, but in order to implement an overriding > mechanism you would need to implement a tristate option as Eric K. > proposed. That is, by default you would have -1 (meaning "don't care") > on per-interface flags, and if this value is changed then the > per-interface value wins over the global one. > > Sensible, but I think it's outside of the scope of this patch, which is > just intended to restore a specific pre-existing userspace expectation. > >> On the other hand, if the global is set to '0', then per-interface value will be >> honored (overrides global). So, the meaning of global varies based on its value. >> Isn't that confusing as well. > > I don't find this confusing though. Setting the global flag always has > the meaning of "force enabling DAD on all interfaces". > > You would have the same problem if you chose a logical AND between > global and per-interface flag. There, setting the global flag would mean > "force disabling DAD on all interfaces". > > So the only indisputable improvement I see here would be to implement a > "don't care" value (either for global or for per-interface flags). But > I'd rather agree with Nicolas that we should fix a potentially broken > userspace assumption first. Agree. Thanks, ~Girish ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-14 13:21 ` [PATCH net v2] " Nicolas Dichtel 2017-11-14 13:53 ` Stefano Brivio 2017-11-14 18:30 ` Girish Moodalbail @ 2017-11-15 10:17 ` Nicolas Dichtel 2017-11-15 10:25 ` David Miller 2 siblings, 1 reply; 18+ messages in thread From: Nicolas Dichtel @ 2017-11-15 10:17 UTC (permalink / raw) To: davem; +Cc: netdev, Stefano Brivio, Matteo Croce, Erik Kline Le 14/11/2017 à 14:21, Nicolas Dichtel a écrit : > With commits 35e015e1f577 and a2d3f3e33853, the global 'accept_dad' flag > is also taken into account (default value is 1). If either global or > per-interface flag is non-zero, DAD will be enabled on a given interface. > > This is not backward compatible: before those patches, the user could > disable DAD just by setting the per-interface flag to 0. Now, the > user instead needs to set both flags to 0 to actually disable DAD. > > Restore the previous behaviour by setting the default for the global > 'accept_dad' flag to 0. This way, DAD is still enabled by default, > as per-interface flags are set to 1 on device creation, but setting > them to 0 is enough to disable DAD on a given interface. > > - Before 35e015e1f57a7 and a2d3f3e33853: > global per-interface DAD enabled > [default] 1 1 yes > X 0 no > X 1 yes > > - After 35e015e1f577 and a2d3f3e33853: > global per-interface DAD enabled > [default] 1 1 yes > 0 0 no > 0 1 yes > 1 0 yes > > - After this fix: > global per-interface DAD enabled > 1 1 yes > 0 0 no > [default] 0 1 yes > 1 0 yes > > Fixes: 35e015e1f577 ("ipv6: fix net.ipv6.conf.all interface DAD handlers") > Fixes: a2d3f3e33853 ("ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real") > CC: Stefano Brivio <sbrivio@redhat.com> > CC: Matteo Croce <mcroce@redhat.com> > CC: Erik Kline <ek@google.com> > Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> David, I saw that you pushed this patch in net-next instead of net. Is it intentional? I was expecting to see it in net, to fix the 4.14. Thank you, Nicolas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-15 10:17 ` Nicolas Dichtel @ 2017-11-15 10:25 ` David Miller 2017-11-15 10:49 ` Nicolas Dichtel 0 siblings, 1 reply; 18+ messages in thread From: David Miller @ 2017-11-15 10:25 UTC (permalink / raw) To: nicolas.dichtel; +Cc: netdev, sbrivio, mcroce, ek From: Nicolas Dichtel <nicolas.dichtel@6wind.com> Date: Wed, 15 Nov 2017 11:17:28 +0100 > I saw that you pushed this patch in net-next instead of net. Is it intentional? > I was expecting to see it in net, to fix the 4.14. All changes are going into net-next as I prepare to send a pull request to Linus for the merge window. This is always how things happen. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH net v2] ipv6: set all.accept_dad to 0 by default 2017-11-15 10:25 ` David Miller @ 2017-11-15 10:49 ` Nicolas Dichtel 0 siblings, 0 replies; 18+ messages in thread From: Nicolas Dichtel @ 2017-11-15 10:49 UTC (permalink / raw) To: David Miller; +Cc: netdev, sbrivio, mcroce, ek Le 15/11/2017 à 11:25, David Miller a écrit : > From: Nicolas Dichtel <nicolas.dichtel@6wind.com> > Date: Wed, 15 Nov 2017 11:17:28 +0100 > >> I saw that you pushed this patch in net-next instead of net. Is it intentional? >> I was expecting to see it in net, to fix the 4.14. > > All changes are going into net-next as I prepare to send a pull request > to Linus for the merge window. > > This is always how things happen. > Oh ok, thanks for the explanation. It's the first time I submit a patch just before the pull request of net-next ;-) Nicolas ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2017-11-15 10:49 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-11-13 13:45 [PATCH net] ipv6: set all.accept_dad to 0 by default Nicolas Dichtel 2017-11-13 14:21 ` Erik Kline 2017-11-13 14:28 ` Matteo Croce 2017-11-13 14:32 ` Stefano Brivio 2017-11-13 14:52 ` Maciej Żenczykowski 2017-11-13 15:05 ` Stefano Brivio 2017-11-13 16:09 ` Nicolas Dichtel 2017-11-14 2:42 ` Stefano Brivio 2017-11-14 2:24 ` Stefano Brivio 2017-11-14 9:43 ` Nicolas Dichtel 2017-11-14 13:21 ` [PATCH net v2] " Nicolas Dichtel 2017-11-14 13:53 ` Stefano Brivio 2017-11-14 18:30 ` Girish Moodalbail 2017-11-14 19:10 ` Stefano Brivio 2017-11-14 20:52 ` Girish Moodalbail 2017-11-15 10:17 ` Nicolas Dichtel 2017-11-15 10:25 ` David Miller 2017-11-15 10:49 ` Nicolas Dichtel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).