]> git.baikalelectronics.ru Git - kernel.git/commit
[LLX]: SOCK_DGRAM interface fixes
authorStephen Hemminger <shemminger@osdl.org>
Thu, 3 Aug 2006 23:38:49 +0000 (16:38 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sat, 5 Aug 2006 05:59:50 +0000 (22:59 -0700)
commit7db043f8f9459a71be0a4d88a8987797a88d43cf
tree7e90f97222f776db8a01c51256c7071e35523543
parent9d42d94e1b768b2f6f5966c76c8d1c422294b9bb
[LLX]: SOCK_DGRAM interface fixes

The datagram interface of LLC is broken in a couple of ways.
These were discovered when trying to use it to build an out-of-kernel
version of STP.

First it didn't pass the source address of the received packet
in recvfrom(). It needs to copy the source address of received LLC packets
into the socket control block. At the same time fix a security issue
because there was uninitialized data leakage. Every recvfrom call
was just copying out old data.

Second, LLC should not merge multiple packets in one receive call
on datagram sockets. LLC should preserve packet boundaries on
SOCK_DGRAM.

This fix goes against the old historical comments about UNIX98 semantics
but without this fix SOCK_DGRAM is broken and useless. So either ANK's
interpretation was incorect or UNIX98 standard was wrong.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Acked-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/llc/af_llc.c
net/llc/llc_sap.c