recvfrom with MSG_PEEK

Niels Provos (
Tue, 20 May 1997 22:04:36 +0200 (DFT)


Today I tried to port a BSD program to Linux and found the following
incompatiblity in recvfrom in libc-5.4.7 with Kernel 2.0.28. I believe
recvfrom is a syscall:
recvfrom(sock, (char *)NULL, 0, MSG_PEEK, (struct sockaddr *)&sin, &size)

should return the address from which the data was sent in sin. This does
not happen on Linux but on *BSD. Where as calling with "(char *)buf, 1"
instead of "(char *)NULL, 0" yields the desired effect.

If somebody could do the fixing please :-)


- PHYSnet Rechnerverbund PGP V2.6 Public key via finger or key server
Niels Provos
Universitaet Hamburg WWW:
Jungiusstrasse 9 E-Mail:
Germany 20355 Hamburg Tel.: +49 40 4123-2404 Fax: -6571