Re: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC



On Tuesday 06 February 2007 21:11, David Schwartz wrote:
Why not improve consistency and make unix_dgram_recvmsg() return the
full packet length? So it would behave as UDP does. What do you think
about adding the following code to linux/net/unix/af_unix.c:

It would be nice if the world worked that way, but you can't break
POSIX compliance. Perhaps another receive flag?

I now understand that setting the MSG_TRUNC flag is only applicable for
PF_PACKET. I do not argue about that any more. :-)

What I question is the return value when receiving from a local socket
using recv(). Sorry, I don't know what the POSIX standard has to say
about receiving from local sockets in contrast to UDP sockets as my only
reference are the man pages.

According to "man 2 recv", on success the return value is the "the number
of bytes received". Since patch-2.6.8, UDP is always returning the full
packet length. I'd like to see local sockets (PF_UNIX) to do the same.

Does POSIX stipulate a different behaviour for local sockets?

Cheers
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Determining if it is "safe" to send UDP packets
    ... for receiving Udp data. ... I'm receiving from a camera lines of data at 55 Hz. ... the next packet hits the wire. ... Another problem with TCP is its assumption that a lost packet is due to ...
    (microsoft.public.win32.programmer.kernel)
  • Re: UDP socket
    ... processing so the receiving application is slow in speed as compared to ... I dont want any packet loss. ... UDP is unreliable, queues can be full on many layers, packets can be altered in transmissions, and contain errors - leading ... a router inbetween discards the packet for whatever reason. ...
    (comp.unix.programmer)
  • Re: Incoherent E-mails
    ... The Novell crap was originally run on IPX ... The term in the early-mid nineties was "packet storm". ... The original advantage of UDP was ... > 60 bytes for TCP. ...
    (alt.computer.security)
  • Re: Linux equivalent for ioctlsocket(FIONREAD) on datagram sockets
    ... blocking and non-blocking UDP sends are essentially the same. ... UDP is defined us unreliable. ... achieves packet error rate of ~1E-7 but hits the wall when we try to ... shouldn't want:(to receive UDP datagrams at low error rate. ...
    (comp.os.linux.development.apps)
  • Re: recvfrom() strange operation
    ... no matter what your network looks ... discover packet loss, partially loss and joinde packet and octett ... And the most important sfrtp working fine over TCP or UDP ... "frames" (or whatever you are calling your higher layer protocol ...
    (comp.os.linux.development.system)