Commit 4ccc1453 authored by David S. Miller's avatar David S. Miller Committed by Zheng Zengkai
Browse files

Revert "net: bonding: fix error return code of bond_neigh_init()"



stable inclusion
from stable-5.10.27
commit 36478a9ec5afd4efd031527d0371bf8f61e5aa91
bugzilla: 51493

--------------------------------

commit 080bfa1e upstream.

This reverts commit 2055a99d.

This change rejects legitimate configurations.

A slave doesn't need to exist nor implement ndo_slave_setup.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatar&nbsp; Weilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 9df3f0c4
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -3918,15 +3918,11 @@ static int bond_neigh_init(struct neighbour *n)

	rcu_read_lock();
	slave = bond_first_slave_rcu(bond);
	if (!slave) {
		ret = -EINVAL;
	if (!slave)
		goto out;
	}
	slave_ops = slave->dev->netdev_ops;
	if (!slave_ops->ndo_neigh_setup) {
		ret = -EINVAL;
	if (!slave_ops->ndo_neigh_setup)
		goto out;
	}

	/* TODO: find another way [1] to implement this.
	 * Passing a zeroed structure is fragile,