[Asterisk-Dev] EAGAIN - recvfrom - bad udp checksum

Olle E. Johansson oej at edvina.net
Tue Nov 2 13:27:36 MST 2004


The SIP channels report "Bad UDP checksum" on some packets, based on the
error code EAGAIN in the recvfrom() socket function.

On Linux, the manpage says:
        If  no  messages  are available at the socket, the receive
        calls wait for a message to arrive, unless the  socket  is
        nonblocking  (see  fcntl(2)) in which case the value -1 is
        returned and the external variable errno  set  to  EAGAIN.
        The  receive  calls normally return any data available, up
        to the requested amount, rather than waiting  for  receipt
        of the full amount requested.


However, on FreeBSD, the man page says:
  [EAGAIN]
	The socket is marked non-blocking, and the receive
	operation would block, or a receive timeout had been
	set, and the timeout expired before data were
	received.


My question is: Where did the "Bad UDP checksum" come from?
Should we handle the EAGAIN error in different ways on different platforms?

/O



More information about the asterisk-dev mailing list