radiusd deadlock on recvfrom on port 1814

Alan DeKok aland at deployingradius.com
Wed Oct 31 08:13:20 CET 2007


Ryan Melendez wrote:
> recvfrom() blocks on datagram sockets just like any other type of socket
> unless it gets a S0_RCVTIMEO or the O_NONBLOCK is set (in which case you
> would receive an error). 

  Hmm... I guess I hadn't run into that before, because select() never
lied about data being available.

  The simplest solution on your system is to set O_NONBLOCK on the
sockets.  But that is just a work-around for the kernel bug (i.e. race
condition).  If data is ready on a socket, it means that data is
ready... blocking on the recvfrom() after telling the application that
data is ready is not very nice.

  Alan DeKok.



More information about the Freeradius-Users mailing list