]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.51/bonding-rlb-mode-of-bond-should-not-alter-arp-originating-via-bridge.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.51 / bonding-rlb-mode-of-bond-should-not-alter-arp-originating-via-bridge.patch
1 From 8f8cfb2ed5a5f6492c66e4eb56ef8360794948de Mon Sep 17 00:00:00 2001
2 From: Zheng Li <zheng.x.li@oracle.com>
3 Date: Wed, 19 Jun 2013 00:53:47 -0700
4 Subject: bonding: rlb mode of bond should not alter ARP originating via bridge
5
6 From: Zheng Li <zheng.x.li@oracle.com>
7
8 [ Upstream commit 567b871e503316b0927e54a3d7c86d50b722d955 ]
9
10 Do not modify or load balance ARP packets passing through balance-alb
11 mode (wherein the ARP did not originate locally, and arrived via a bridge).
12
13 Modifying pass-through ARP replies causes an incorrect MAC address
14 to be placed into the ARP packet, rendering peers unable to communicate
15 with the actual destination from which the ARP reply originated.
16
17 Load balancing pass-through ARP requests causes an entry to be
18 created for the peer in the rlb table, and bond_alb_monitor will
19 occasionally issue ARP updates to all peers in the table instrucing them
20 as to which MAC address they should communicate with; this occurs when
21 some event sets rx_ntt. In the bridged case, however, the MAC address
22 used for the update would be the MAC of the slave, not the actual source
23 MAC of the originating destination. This would render peers unable to
24 communicate with the destinations beyond the bridge.
25
26 Signed-off-by: Zheng Li <zheng.x.li@oracle.com>
27 Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
28 Signed-off-by: David S. Miller <davem@davemloft.net>
29 Signed-off-by: Matthew O'Connor <liquidhorse@gmail.com>
30 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31 ---
32 drivers/net/bonding/bond_alb.c | 6 ++++++
33 drivers/net/bonding/bonding.h | 13 +++++++++++++
34 2 files changed, 19 insertions(+)
35
36 --- a/drivers/net/bonding/bond_alb.c
37 +++ b/drivers/net/bonding/bond_alb.c
38 @@ -704,6 +704,12 @@ static struct slave *rlb_arp_xmit(struct
39 struct arp_pkt *arp = arp_pkt(skb);
40 struct slave *tx_slave = NULL;
41
42 + /* Don't modify or load balance ARPs that do not originate locally
43 + * (e.g.,arrive via a bridge).
44 + */
45 + if (!bond_slave_has_mac(bond, arp->mac_src))
46 + return NULL;
47 +
48 if (arp->op_code == htons(ARPOP_REPLY)) {
49 /* the arp must be sent on the selected
50 * rx channel
51 --- a/drivers/net/bonding/bonding.h
52 +++ b/drivers/net/bonding/bonding.h
53 @@ -18,6 +18,7 @@
54 #include <linux/timer.h>
55 #include <linux/proc_fs.h>
56 #include <linux/if_bonding.h>
57 +#include <linux/etherdevice.h>
58 #include <linux/cpumask.h>
59 #include <linux/in6.h>
60 #include <linux/netpoll.h>
61 @@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir
62 }
63 #endif
64
65 +static inline struct slave *bond_slave_has_mac(struct bonding *bond,
66 + const u8 *mac)
67 +{
68 + int i = 0;
69 + struct slave *tmp;
70 +
71 + bond_for_each_slave(bond, tmp, i)
72 + if (!compare_ether_addr_64bits(mac, tmp->dev->dev_addr))
73 + return tmp;
74 +
75 + return NULL;
76 +}
77
78 /* exported from bond_main.c */
79 extern int bond_net_id;