* [PATCHv2 net 1/3] bonding: use unspecified address if no available link local address
2022-08-30 9:37 [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation Hangbin Liu
@ 2022-08-30 9:37 ` Hangbin Liu
2022-08-30 9:37 ` [PATCHv2 net 2/3] bonding: add all node mcast address when slave up Hangbin Liu
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Hangbin Liu @ 2022-08-30 9:37 UTC (permalink / raw)
To: netdev
Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, David S . Miller,
Jakub Kicinski, Jonathan Toppins, Paolo Abeni, David Ahern,
Hangbin Liu, LiLiang
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: 5e1eeef69c0f ("bonding: NS target should accept link local address")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
drivers/net/bonding/bond_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2f4da2c13c0a..531c7465bc51 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3167,6 +3167,9 @@ static void bond_ns_send_all(struct bonding *bond, struct slave *slave)
found:
if (!ipv6_dev_get_saddr(dev_net(dst->dev), dst->dev, &targets[i], 0, &saddr))
bond_ns_send(slave, &targets[i], &saddr, tags);
+ else
+ bond_ns_send(slave, &targets[i], &in6addr_any, tags);
+
dst_release(dst);
kfree(tags);
}
--
2.37.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCHv2 net 2/3] bonding: add all node mcast address when slave up
2022-08-30 9:37 [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation Hangbin Liu
2022-08-30 9:37 ` [PATCHv2 net 1/3] bonding: use unspecified address if no available link local address Hangbin Liu
@ 2022-08-30 9:37 ` Hangbin Liu
2022-08-30 9:37 ` [PATCHv2 net 3/3] bonding: accept unsolicited NA message Hangbin Liu
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Hangbin Liu @ 2022-08-30 9:37 UTC (permalink / raw)
To: netdev
Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, David S . Miller,
Jakub Kicinski, Jonathan Toppins, Paolo Abeni, David Ahern,
Hangbin Liu, LiLiang
When a link is enslave to bond, it need to set the interface down first.
This makes the slave remove mac multicast address 33:33:00:00:00:01(The
IPv6 multicast address ff02::1 is kept even when the interface down). When
bond set the slave up, ipv6_mc_up() was not called due to commit c2edacf80e15
("bonding / ipv6: no addrconf for slaves separately from master").
This is not an issue before we adding the lladdr target feature for bonding,
as the mac multicast address will be added back when bond interface up and
join group ff02::1.
But after adding lladdr target feature for bonding. When user set a lladdr
target, the unsolicited NA message with all-nodes multicast dest will be
dropped as the slave interface never add 33:33:00:00:00:01 back.
Fix this by calling ipv6_mc_up() to add 33:33:00:00:00:01 back when
the slave interface up.
Reported-by: LiLiang <liali@redhat.com>
Fixes: 5e1eeef69c0f ("bonding: NS target should accept link local address")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
net/ipv6/addrconf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index e15f64f22fa8..10ce86bf228e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3557,11 +3557,15 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
fallthrough;
case NETDEV_UP:
case NETDEV_CHANGE:
- if (dev->flags & IFF_SLAVE)
+ if (idev && idev->cnf.disable_ipv6)
break;
- if (idev && idev->cnf.disable_ipv6)
+ if (dev->flags & IFF_SLAVE) {
+ if (event == NETDEV_UP && !IS_ERR_OR_NULL(idev) &&
+ dev->flags & IFF_UP && dev->flags & IFF_MULTICAST)
+ ipv6_mc_up(idev);
break;
+ }
if (event == NETDEV_UP) {
/* restore routes for permanent addresses */
--
2.37.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCHv2 net 3/3] bonding: accept unsolicited NA message
2022-08-30 9:37 [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation Hangbin Liu
2022-08-30 9:37 ` [PATCHv2 net 1/3] bonding: use unspecified address if no available link local address Hangbin Liu
2022-08-30 9:37 ` [PATCHv2 net 2/3] bonding: add all node mcast address when slave up Hangbin Liu
@ 2022-08-30 9:37 ` Hangbin Liu
2022-09-03 3:40 ` [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation Jakub Kicinski
2022-09-05 9:20 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Hangbin Liu @ 2022-08-30 9:37 UTC (permalink / raw)
To: netdev
Cc: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, David S . Miller,
Jakub Kicinski, Jonathan Toppins, Paolo Abeni, David Ahern,
Hangbin Liu, LiLiang
The unsolicited NA message with all-nodes multicast dest address should
be valid, as this also means the link could reach the target.
Also rename bond_validate_ns() to bond_validate_na().
Reported-by: LiLiang <liali@redhat.com>
Fixes: 5e1eeef69c0f ("bonding: NS target should accept link local address")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
drivers/net/bonding/bond_main.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 531c7465bc51..5c2febe94428 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3201,12 +3201,19 @@ static bool bond_has_this_ip6(struct bonding *bond, struct in6_addr *addr)
return ret;
}
-static void bond_validate_ns(struct bonding *bond, struct slave *slave,
+static void bond_validate_na(struct bonding *bond, struct slave *slave,
struct in6_addr *saddr, struct in6_addr *daddr)
{
int i;
- if (ipv6_addr_any(saddr) || !bond_has_this_ip6(bond, daddr)) {
+ /* Ignore NAs that:
+ * 1. Source address is unspecified address.
+ * 2. Dest address is neither all-nodes multicast address nor
+ * exist on bond interface.
+ */
+ if (ipv6_addr_any(saddr) ||
+ (!ipv6_addr_equal(daddr, &in6addr_linklocal_allnodes) &&
+ !bond_has_this_ip6(bond, daddr))) {
slave_dbg(bond->dev, slave->dev, "%s: sip %pI6c tip %pI6c not found\n",
__func__, saddr, daddr);
return;
@@ -3249,14 +3256,14 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond,
* see bond_arp_rcv().
*/
if (bond_is_active_slave(slave))
- bond_validate_ns(bond, slave, saddr, daddr);
+ bond_validate_na(bond, slave, saddr, daddr);
else if (curr_active_slave &&
time_after(slave_last_rx(bond, curr_active_slave),
curr_active_slave->last_link_up))
- bond_validate_ns(bond, slave, saddr, daddr);
+ bond_validate_na(bond, slave, saddr, daddr);
else if (curr_arp_slave &&
bond_time_in_interval(bond, slave_last_tx(curr_arp_slave), 1))
- bond_validate_ns(bond, slave, saddr, daddr);
+ bond_validate_na(bond, slave, saddr, daddr);
out:
return RX_HANDLER_ANOTHER;
--
2.37.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation
2022-08-30 9:37 [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation Hangbin Liu
` (2 preceding siblings ...)
2022-08-30 9:37 ` [PATCHv2 net 3/3] bonding: accept unsolicited NA message Hangbin Liu
@ 2022-09-03 3:40 ` Jakub Kicinski
2022-09-05 9:20 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2022-09-03 3:40 UTC (permalink / raw)
To: Jay Vosburgh
Cc: Hangbin Liu, netdev, Veaceslav Falico, Andy Gospodarek,
David S . Miller, Jonathan Toppins, Paolo Abeni, David Ahern
On Tue, 30 Aug 2022 17:37:19 +0800 Hangbin Liu wrote:
> This patch set fixed 3 issues when setting lladdr as bonding IPv6 target.
> Please see each patch for the details.
Hi Jay, is this one still on your radar?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation
2022-08-30 9:37 [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation Hangbin Liu
` (3 preceding siblings ...)
2022-09-03 3:40 ` [PATCHv2 net 0/3] bonding: fix lladdr finding and confirmation Jakub Kicinski
@ 2022-09-05 9:20 ` patchwork-bot+netdevbpf
4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-05 9:20 UTC (permalink / raw)
To: Hangbin Liu
Cc: netdev, j.vosburgh, vfalico, andy, davem, kuba, jtoppins, pabeni,
dsahern
Hello:
This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 30 Aug 2022 17:37:19 +0800 you wrote:
> This patch set fixed 3 issues when setting lladdr as bonding IPv6 target.
> Please see each patch for the details.
>
> v2: separate the patch to 3 parts
>
> Hangbin Liu (3):
> bonding: use unspecified address if no available link local address
> bonding: add all node mcast address when slave up
> bonding: accept unsolicited NA message
>
> [...]
Here is the summary with links:
- [PATCHv2,net,1/3] bonding: use unspecified address if no available link local address
https://git.kernel.org/netdev/net/c/b7f14132bf58
- [PATCHv2,net,2/3] bonding: add all node mcast address when slave up
https://git.kernel.org/netdev/net/c/fd16eb948ea8
- [PATCHv2,net,3/3] bonding: accept unsolicited NA message
https://git.kernel.org/netdev/net/c/592335a4164c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread