From: Hangbin Liu Date: Fri, 27 May 2022 06:44:39 +0000 (+0800) Subject: bonding: NS target should accept link local address X-Git-Tag: baikal/aarch64/sdk6.1~3836^2~28 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=880632c7e38ee140eac7cb721c76fe951fa9d23a;p=kernel.git bonding: NS target should accept link local address When setting bond NS target, we use bond_is_ip6_target_ok() to check if the address valid. The link local address was wrongly rejected in bond_changelink(), as most time the user just set the ARP/NS target to gateway, while the IPv6 gateway is always a link local address when user set up interface via SLAAC. So remove the link local addr check when setting bond NS target. Fixes: 6d07932dd659 ("bonding: add new option ns_ip6_target") Reported-by: Li Liang Signed-off-by: Hangbin Liu Reviewed-by: Jonathan Toppins Acked-by: Jay Vosburgh Signed-off-by: David S. Miller --- diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c index f427fa1737c77..6f404f9c34e34 100644 --- a/drivers/net/bonding/bond_netlink.c +++ b/drivers/net/bonding/bond_netlink.c @@ -290,11 +290,6 @@ static int bond_changelink(struct net_device *bond_dev, struct nlattr *tb[], addr6 = nla_get_in6_addr(attr); - if (ipv6_addr_type(&addr6) & IPV6_ADDR_LINKLOCAL) { - NL_SET_ERR_MSG(extack, "Invalid IPv6 addr6"); - return -EINVAL; - } - bond_opt_initextra(&newval, &addr6, sizeof(addr6)); err = __bond_opt_set(bond, BOND_OPT_NS_TARGETS, &newval);