mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
udp: increment UDP_MIB_INERRORS if copy failed
In UDP recvmsg(), we miss an increase of UDP_MIB_INERRORS if the copy of skb to userspace failed for whatever reason. Reported-by: Shawn Bohrer <sbohrer@rgmadvisors.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
521130d11f
commit
979402b16c
@ -1226,6 +1226,11 @@ try_again:
|
||||
|
||||
if (unlikely(err)) {
|
||||
trace_kfree_skb(skb, udp_recvmsg);
|
||||
if (!peeked) {
|
||||
atomic_inc(&sk->sk_drops);
|
||||
UDP_INC_STATS_USER(sock_net(sk),
|
||||
UDP_MIB_INERRORS, is_udplite);
|
||||
}
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
|
@ -394,6 +394,17 @@ try_again:
|
||||
}
|
||||
if (unlikely(err)) {
|
||||
trace_kfree_skb(skb, udpv6_recvmsg);
|
||||
if (!peeked) {
|
||||
atomic_inc(&sk->sk_drops);
|
||||
if (is_udp4)
|
||||
UDP_INC_STATS_USER(sock_net(sk),
|
||||
UDP_MIB_INERRORS,
|
||||
is_udplite);
|
||||
else
|
||||
UDP6_INC_STATS_USER(sock_net(sk),
|
||||
UDP_MIB_INERRORS,
|
||||
is_udplite);
|
||||
}
|
||||
goto out_free;
|
||||
}
|
||||
if (!peeked) {
|
||||
|
Loading…
Reference in New Issue
Block a user