int err;
if (!dev->netdev_ops->ndo_xdp_xmit) {
- bpf_warn_invalid_xdp_redirect(dev->ifindex);
return -EOPNOTSUPP;
}
fwd = dev_get_by_index_rcu(dev_net(dev), index);
ri->ifindex = 0;
if (unlikely(!fwd)) {
- bpf_warn_invalid_xdp_redirect(index);
err = -EINVAL;
goto out;
}
dev = dev_get_by_index_rcu(dev_net(dev), index);
ri->ifindex = 0;
if (unlikely(!dev)) {
- bpf_warn_invalid_xdp_redirect(index);
return -EINVAL;
}
}
EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);
-void bpf_warn_invalid_xdp_redirect(u32 ifindex)
-{
- WARN_ONCE(1, "Illegal XDP redirect to unsupported device ifindex(%i)\n", ifindex);
-}
-
static bool __is_valid_sock_ops_access(int off, int size)
{
if (off < 0 || off >= sizeof(struct bpf_sock_ops))