Message ID | 1498165026.2503.21.camel@redhat.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Thu, Jun 22, 2017, at 22:57, Paolo Abeni wrote: > > Can you please check if the following patch fixes the issue? Only > compiled tested here. > > Thanks!!! > --- > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c > index 067a607..80d89fe 100644 > --- a/net/ipv4/udp.c > +++ b/net/ipv4/udp.c > @@ -1446,16 +1446,19 @@ static struct sk_buff > *__first_packet_length(struct sock *sk, > { > struct sk_buff *skb; > > - while ((skb = skb_peek(rcvq)) != NULL && > - udp_lib_checksum_complete(skb)) { > - __UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, > - IS_UDPLITE(sk)); > - __UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, > - IS_UDPLITE(sk)); > - atomic_inc(&sk->sk_drops); > - __skb_unlink(skb, rcvq); > - *total += skb->truesize; > - kfree_skb(skb); > + while ((skb = skb_peek(rcvq)) != NULL) { > + if (udp_lib_checksum_complete(skb)) { > + __UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, > + IS_UDPLITE(sk)); > + __UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, > + IS_UDPLITE(sk)); > + atomic_inc(&sk->sk_drops); > + __skb_unlink(skb, rcvq); > + *total += skb->truesize; > + kfree_skb(skb); > + } else { > + udp_set_dev_scratch(skb); It needs a "break;" here. > + } > } > return skb; > } Bye, Hannes
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 067a607..80d89fe 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1446,16 +1446,19 @@ static struct sk_buff *__first_packet_length(struct sock *sk, { struct sk_buff *skb; - while ((skb = skb_peek(rcvq)) != NULL && - udp_lib_checksum_complete(skb)) { - __UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, - IS_UDPLITE(sk)); - __UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, - IS_UDPLITE(sk)); - atomic_inc(&sk->sk_drops); - __skb_unlink(skb, rcvq); - *total += skb->truesize; - kfree_skb(skb); + while ((skb = skb_peek(rcvq)) != NULL) { + if (udp_lib_checksum_complete(skb)) { + __UDP_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, + IS_UDPLITE(sk)); + __UDP_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, + IS_UDPLITE(sk)); + atomic_inc(&sk->sk_drops); + __skb_unlink(skb, rcvq); + *total += skb->truesize; + kfree_skb(skb); + } else { + udp_set_dev_scratch(skb); + } } return skb; }