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:
Родитель
521130d11f
Коммит
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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче