diff mbox series

[net] net/ipv6: allow token to be set when accept_ra disabled

Message ID 20200409065604.817-1-liuhangbin@gmail.com
State New
Headers show
Series [net] net/ipv6: allow token to be set when accept_ra disabled | expand

Commit Message

Hangbin Liu April 9, 2020, 6:56 a.m. UTC
The token setting should not depend on whether accept_ra is enabled or
disabled. The user could set the token at any time. Enable or disable
accept_ra only affects when the token address take effective.

On the other hand, we didn't remove the token setting when disable
accept_ra. So let's just remove the accept_ra checking when user want
to set token address.

Fixes: f53adae4eae5 ("net: ipv6: add tokenized interface identifier support")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv6/addrconf.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 24e319dfb510..4e63330f63e5 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5689,8 +5689,6 @@  static int inet6_set_iftoken(struct inet6_dev *idev, struct in6_addr *token)
 		return -EINVAL;
 	if (dev->flags & (IFF_LOOPBACK | IFF_NOARP))
 		return -EINVAL;
-	if (!ipv6_accept_ra(idev))
-		return -EINVAL;
 	if (idev->cnf.rtr_solicits == 0)
 		return -EINVAL;