summaryrefslogtreecommitdiff
path: root/drivers/net/netkit.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-09-15 19:12:21 +0300
committerJakub Kicinski <kuba@kernel.org>2024-09-15 19:13:19 +0300
commit3561373114c8b3359114e2da27259317dc51145a (patch)
tree3885239a7987bc96fc9eb3684f77ff4d9e42eef7 /drivers/net/netkit.c
parentbe461814aa4cb32aae061404b9a6a83ef3895018 (diff)
parent7052622fccb1efb850c6b55de477f65d03525a30 (diff)
downloadlinux-3561373114c8b3359114e2da27259317dc51145a.tar.xz
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 <kuba@kernel.org>
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;
}