Re: udp_recvmsg: possible bug causing infinite hang?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Does the POSIX standard _not_ give this implicit guarantee ? Whats the 
> point in having a select call that says that the fd is readable, and when 
> I go to read it the blocking read call blocks. Then either select returned 
> a wrong positive or the read is buggy. 
> 	The kernel should mark the socket readable (and hence select returns 
> "readable") only after it has added the incoming data to the socket receive 
> queue or it has changed the state of the socket (in case of TCP connections 
> getting closed), in case of peer closing the connection.
> After that has been done, is the guarantee not there ?

What you're saying is correct.  However, if the UDP handler pulls the data
off of the receive queue and then finds that the datagram is corrupted, it
will go back into the read function to wait for another datagram.  Personally
I think that it should return some other kind of error (not EAGAIN) to indicate
somehow that we discarded a datagram due to a bad checksum.

Chad
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux