diff options
| author | Qingfang Deng <dqfext@gmail.com> | 2025-06-23 11:34:31 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-06-24 16:37:02 -0700 |
| commit | 7eebd219feda99df8292a97faff895a5da8159d6 (patch) | |
| tree | 4d1264507d9d028259a57efc2c062521cee9ccd0 | |
| parent | c9e78afa688afec528784b79bb02d513cdcd6527 (diff) | |
pppoe: drop PACKET_OTHERHOST before skb_share_check()
Align with ip_rcv() by dropping PACKET_OTHERHOST packets before
calling skb_share_check(). This avoids unnecessary skb processing
for packets that will be discarded anyway.
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Acked-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/20250623033431.408810-1-dqfext@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| -rw-r--r-- | drivers/net/ppp/pppoe.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index 68e631718ab0..410effa42ade 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c @@ -372,9 +372,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) * can't change. */ - if (skb->pkt_type == PACKET_OTHERHOST) - goto abort_kfree; - if (sk->sk_state & PPPOX_BOUND) { ppp_input(&po->chan, skb); } else if (sk->sk_state & PPPOX_RELAY) { @@ -418,6 +415,9 @@ static int pppoe_rcv(struct sk_buff *skb, struct net_device *dev, struct pppoe_net *pn; int len; + if (skb->pkt_type == PACKET_OTHERHOST) + goto drop; + skb = skb_share_check(skb, GFP_ATOMIC); if (!skb) goto out; |
