Commit fc59b9a5 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by Paolo Abeni

bonding: fix bond_ipsec_offload_ok return type

Fix the return type which should be bool.

Fixes: 955b785e ("bonding: fix suspicious RCU usage in bond_ipsec_offload_ok()")
Signed-off-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4b3e33fc
...@@ -599,34 +599,28 @@ static bool bond_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *xs) ...@@ -599,34 +599,28 @@ static bool bond_ipsec_offload_ok(struct sk_buff *skb, struct xfrm_state *xs)
struct net_device *real_dev; struct net_device *real_dev;
struct slave *curr_active; struct slave *curr_active;
struct bonding *bond; struct bonding *bond;
int err; bool ok = false;
bond = netdev_priv(bond_dev); bond = netdev_priv(bond_dev);
rcu_read_lock(); rcu_read_lock();
curr_active = rcu_dereference(bond->curr_active_slave); curr_active = rcu_dereference(bond->curr_active_slave);
real_dev = curr_active->dev; real_dev = curr_active->dev;
if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { if (BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP)
err = false;
goto out; goto out;
}
if (!xs->xso.real_dev) { if (!xs->xso.real_dev)
err = false;
goto out; goto out;
}
if (!real_dev->xfrmdev_ops || if (!real_dev->xfrmdev_ops ||
!real_dev->xfrmdev_ops->xdo_dev_offload_ok || !real_dev->xfrmdev_ops->xdo_dev_offload_ok ||
netif_is_bond_master(real_dev)) { netif_is_bond_master(real_dev))
err = false;
goto out; goto out;
}
err = real_dev->xfrmdev_ops->xdo_dev_offload_ok(skb, xs); ok = real_dev->xfrmdev_ops->xdo_dev_offload_ok(skb, xs);
out: out:
rcu_read_unlock(); rcu_read_unlock();
return err; return ok;
} }
static const struct xfrmdev_ops bond_xfrmdev_ops = { static const struct xfrmdev_ops bond_xfrmdev_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment