Skip to content

Commit b7f1413

Browse files
liuhangbindavem330
authored andcommitted
bonding: use unspecified address if no available link local address
When ns_ip6_target was set, the ipv6_dev_get_saddr() will be called to get available source address and send IPv6 neighbor solicit message. If the target is global address, ipv6_dev_get_saddr() will get any available src address. But if the target is link local address, ipv6_dev_get_saddr() will only get available address from our interface, i.e. the corresponding bond interface. But before bond interface up, all the address is tentative, while ipv6_dev_get_saddr() will ignore tentative address. This makes we can't find available link local src address, then bond_ns_send() will not be called and no NS message was sent. Finally bond interface will keep in down state. Fix this by sending NS with unspecified address if there is no available source address. Reported-by: LiLiang <liali@redhat.com> Fixes: 5e1eeef ("bonding: NS target should accept link local address") Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c907140 commit b7f1413

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,6 +3167,9 @@ static void bond_ns_send_all(struct bonding *bond, struct slave *slave)
31673167
found:
31683168
if (!ipv6_dev_get_saddr(dev_net(dst->dev), dst->dev, &targets[i], 0, &saddr))
31693169
bond_ns_send(slave, &targets[i], &saddr, tags);
3170+
else
3171+
bond_ns_send(slave, &targets[i], &in6addr_any, tags);
3172+
31703173
dst_release(dst);
31713174
kfree(tags);
31723175
}

0 commit comments

Comments
 (0)