aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netkit.c
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2024-09-15 16:12:21 +0000
committerJakub Kicinski <[email protected]>2024-09-15 16:13:19 +0000
commit3561373114c8b3359114e2da27259317dc51145a (patch)
tree3885239a7987bc96fc9eb3684f77ff4d9e42eef7 /drivers/net/netkit.c
parentnet/mlx5: HWS, check the correct variable in hws_send_ring_alloc_sq() (diff)
parentnetfilter: nft_socket: Fix a NULL vs IS_ERR() bug in nft_socket_cgroup_subtre... (diff)
downloadkernel-3561373114c8b3359114e2da27259317dc51145a.tar.gz
kernel-3561373114c8b3359114e2da27259317dc51145a.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in late fixes to prepare for the 6.12 net-next PR. No conflicts or adjacent changes. Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/netkit.c')
-rw-r--r--drivers/net/netkit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/netkit.c b/drivers/net/netkit.c
index d0036a856039..059269557d92 100644
--- a/drivers/net/netkit.c
+++ b/drivers/net/netkit.c
@@ -65,6 +65,7 @@ static struct netkit *netkit_priv(const struct net_device *dev)
static netdev_tx_t netkit_xmit(struct sk_buff *skb, struct net_device *dev)
{
+ struct bpf_net_context __bpf_net_ctx, *bpf_net_ctx;
struct netkit *nk = netkit_priv(dev);
enum netkit_action ret = READ_ONCE(nk->policy);
netdev_tx_t ret_dev = NET_XMIT_SUCCESS;
@@ -72,6 +73,7 @@ static netdev_tx_t netkit_xmit(struct sk_buff *skb, struct net_device *dev)
struct net_device *peer;
int len = skb->len;
+ bpf_net_ctx = bpf_net_ctx_set(&__bpf_net_ctx);
rcu_read_lock();
peer = rcu_dereference(nk->peer);
if (unlikely(!peer || !(peer->flags & IFF_UP) ||
@@ -110,6 +112,7 @@ drop_stats:
break;
}
rcu_read_unlock();
+ bpf_net_ctx_clear(bpf_net_ctx);
return ret_dev;
}