Skip to content

Commit

Permalink
Revert "net: bonding: fix error return code of bond_neigh_init()"
Browse files Browse the repository at this point in the history
commit 080bfa1 upstream.

This reverts commit 2055a99.

This change rejects legitimate configurations.

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

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
David S. Miller authored and Greg Kroah-Hartman committed Apr 7, 2021
1 parent a73c62a commit 91a4e81
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3917,15 +3917,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,
Expand Down

0 comments on commit 91a4e81

Please sign in to comment.