lkml.org 
[lkml]   [2018]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net 2/2] rxrpc: Fix the data_ready handler
From
Date


On 10/05/2018 06:43 AM, David Howells wrote:
> Fix the rxrpc_data_ready() function to pick up all packets and to not miss
> any. There are two problems:
>


> + for (;;) {
> + skb = skb_recv_udp(udp_sk, 0, 1, &ret);
> + if (!skb) {
> + if (ret == -EAGAIN)
> + return;
> +
> + /* If there was a transmission failure, we get an error
> + * here that we need to ignore.
> + */
> + _debug("UDP socket error %d", ret);
> + continue;
> + }
> +
> + rxrpc_new_skb(skb, rxrpc_skb_rx_received);
> +
> + /* we'll probably need to checksum it (didn't call sock_recvmsg) */
> + if (skb_checksum_complete(skb)) {
> + rxrpc_free_skb(skb, rxrpc_skb_rx_freed);
> + __UDP_INC_STATS(sock_net(udp_sk), UDP_MIB_INERRORS, 0);
> + _debug("csum failed");
> + continue;
> + }
> +
> + __UDP_INC_STATS(sock_net(udp_sk), UDP_MIB_INDATAGRAMS, 0);
> +
> + rxrpc_input_packet(udp_sk, skb);
> + }
> +}


This looks a potential infinite loop to me ?

If not, please add a comment explaining why there is no apparent limit.



\
 
 \ /
  Last update: 2018-10-05 15:52    [W:0.089 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site