]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.1.3/bonding-fix-arp_validate-toggling-in-active-backup-mode.patch
drop queue-4.4/mm-vmstat-make-quiet_vmstat-lighter.patch
[thirdparty/kernel/stable-queue.git] / releases / 5.1.3 / bonding-fix-arp_validate-toggling-in-active-backup-mode.patch
1 From foo@baz Wed 15 May 2019 07:51:30 AM CEST
2 From: Jarod Wilson <jarod@redhat.com>
3 Date: Fri, 10 May 2019 17:57:09 -0400
4 Subject: bonding: fix arp_validate toggling in active-backup mode
5
6 From: Jarod Wilson <jarod@redhat.com>
7
8 [ Upstream commit a9b8a2b39ce65df45687cf9ef648885c2a99fe75 ]
9
10 There's currently a problem with toggling arp_validate on and off with an
11 active-backup bond. At the moment, you can start up a bond, like so:
12
13 modprobe bonding mode=1 arp_interval=100 arp_validate=0 arp_ip_targets=192.168.1.1
14 ip link set bond0 down
15 echo "ens4f0" > /sys/class/net/bond0/bonding/slaves
16 echo "ens4f1" > /sys/class/net/bond0/bonding/slaves
17 ip link set bond0 up
18 ip addr add 192.168.1.2/24 dev bond0
19
20 Pings to 192.168.1.1 work just fine. Now turn on arp_validate:
21
22 echo 1 > /sys/class/net/bond0/bonding/arp_validate
23
24 Pings to 192.168.1.1 continue to work just fine. Now when you go to turn
25 arp_validate off again, the link falls flat on it's face:
26
27 echo 0 > /sys/class/net/bond0/bonding/arp_validate
28 dmesg
29 ...
30 [133191.911987] bond0: Setting arp_validate to none (0)
31 [133194.257793] bond0: bond_should_notify_peers: slave ens4f0
32 [133194.258031] bond0: link status definitely down for interface ens4f0, disabling it
33 [133194.259000] bond0: making interface ens4f1 the new active one
34 [133197.330130] bond0: link status definitely down for interface ens4f1, disabling it
35 [133197.331191] bond0: now running without any active interface!
36
37 The problem lies in bond_options.c, where passing in arp_validate=0
38 results in bond->recv_probe getting set to NULL. This flies directly in
39 the face of commit 3fe68df97c7f, which says we need to set recv_probe =
40 bond_arp_recv, even if we're not using arp_validate. Said commit fixed
41 this in bond_option_arp_interval_set, but missed that we can get to that
42 same state in bond_option_arp_validate_set as well.
43
44 One solution would be to universally set recv_probe = bond_arp_recv here
45 as well, but I don't think bond_option_arp_validate_set has any business
46 touching recv_probe at all, and that should be left to the arp_interval
47 code, so we can just make things much tidier here.
48
49 Fixes: 3fe68df97c7f ("bonding: always set recv_probe to bond_arp_rcv in arp monitor")
50 CC: Jay Vosburgh <j.vosburgh@gmail.com>
51 CC: Veaceslav Falico <vfalico@gmail.com>
52 CC: Andy Gospodarek <andy@greyhouse.net>
53 CC: "David S. Miller" <davem@davemloft.net>
54 CC: netdev@vger.kernel.org
55 Signed-off-by: Jarod Wilson <jarod@redhat.com>
56 Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
57 Signed-off-by: David S. Miller <davem@davemloft.net>
58 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
59 ---
60 drivers/net/bonding/bond_options.c | 7 -------
61 1 file changed, 7 deletions(-)
62
63 --- a/drivers/net/bonding/bond_options.c
64 +++ b/drivers/net/bonding/bond_options.c
65 @@ -1098,13 +1098,6 @@ static int bond_option_arp_validate_set(
66 {
67 netdev_dbg(bond->dev, "Setting arp_validate to %s (%llu)\n",
68 newval->string, newval->value);
69 -
70 - if (bond->dev->flags & IFF_UP) {
71 - if (!newval->value)
72 - bond->recv_probe = NULL;
73 - else if (bond->params.arp_interval)
74 - bond->recv_probe = bond_arp_rcv;
75 - }
76 bond->params.arp_validate = newval->value;
77
78 return 0;