ipv6: raw: check sk->sk_rcvbuf earlier
Subsystems (2)
PATCH 1/1 ipv6: raw: check sk->sk_rcvbuf earlier
There is no point cloning an skb and having to free the clone if the receive queue of the raw socket is full.
Signed-off-by Eric Dumazet <[email protected]>
--- net/ipv6/raw.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/ipv6/raw.c +7 -0
@@ -160,6 +160,13 @@ static bool ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)if (!raw_v6_match (net, sk, nexthdr, daddr, saddr,inet6_iif (skb),inet6_sdif (skb)))continue ; + +if (atomic_read (&sk->sk_rmem_alloc) >= +READ_ONCE (sk->sk_rcvbuf)) { +atomic_inc (&sk->sk_drops); +continue ; + } + delivered = true;switch (nexthdr) {case IPPROTO_ICMPV6 :
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog
Quoted 4 lines · Eric Dumazet
There is no point cloning an skb and having to free the clone if the receive queue of the raw socket is full.
Signed-off-by Eric Dumazet <[email protected]>
Reviewed-by Willem de Bruijn <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 7 lines · On Thu, 7 Mar 2024 16:29:43 +0000 you wrote:
There is no point cloning an skb and having to free the clone if the receive queue of the raw socket is full.
Signed-off-by Eric Dumazet <[email protected]>--- net/ipv6/raw.c | 7 +++++++ 1 file changed, 7 insertions(+)
Here is the summary with links:
- [net-next] ipv6: raw: check sk->sk_rcvbuf earlier
https://git.kernel.org/netdev/net-next/c/026763ece881
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html