Unverified Commit 512ccf42 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!2345 Backport lts bugfix patch for macvlan

Merge Pull Request from: @ci-robot 
 
PR sync from: Ziyang Xuan <william.xuanziyang@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/KSTDH4SPUS7X24YA45JKFHJAWBEKSL5U/ 
Backport lts commit f916e5988ae4 ("bonding: fix macvlan over
alb bond support").

Hangbin Liu (1):
  bonding: fix macvlan over alb bond support

Jakub Kicinski (1):
  net: remove bond_slave_has_mac_rcu()


-- 
2.25.1
 
https://gitee.com/openeuler/kernel/issues/I85XNK 
 
Link:https://gitee.com/openeuler/kernel/pulls/2345

 

Reviewed-by: default avatarLiu YongQiang <liuyongqiang13@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents 3d72d212 610dda4c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -672,10 +672,10 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
		return NULL;
	arp = (struct arp_pkt *)skb_network_header(skb);

	/* Don't modify or load balance ARPs that do not originate locally
	 * (e.g.,arrive via a bridge).
	/* Don't modify or load balance ARPs that do not originate
	 * from the bond itself or a VLAN directly above the bond.
	 */
	if (!bond_slave_has_mac_rx(bond, arp->mac_src))
	if (!bond_slave_has_mac_rcu(bond, arp->mac_src))
		return NULL;

	dev = ip_dev_find(dev_net(bond->dev), arp->ip_src);
+1 −24
Original line number Diff line number Diff line
@@ -677,37 +677,14 @@ static inline struct slave *bond_slave_has_mac(struct bonding *bond,
}

/* Caller must hold rcu_read_lock() for read */
static inline struct slave *bond_slave_has_mac_rcu(struct bonding *bond,
					       const u8 *mac)
{
	struct list_head *iter;
	struct slave *tmp;

	bond_for_each_slave_rcu(bond, tmp, iter)
		if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
			return tmp;

	return NULL;
}

/* Caller must hold rcu_read_lock() for read */
static inline bool bond_slave_has_mac_rx(struct bonding *bond, const u8 *mac)
static inline bool bond_slave_has_mac_rcu(struct bonding *bond, const u8 *mac)
{
	struct list_head *iter;
	struct slave *tmp;
	struct netdev_hw_addr *ha;

	bond_for_each_slave_rcu(bond, tmp, iter)
		if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
			return true;

	if (netdev_uc_empty(bond->dev))
		return false;

	netdev_for_each_uc_addr(ha, bond->dev)
		if (ether_addr_equal_64bits(mac, ha->addr))
			return true;

	return false;
}