]> git.neil.brown.name Git - history.git/commit
[UDP]: Select handling of bad checksums.
authorStephen Hemminger <shemminger@osdl.org>
Tue, 30 Nov 2004 13:26:12 +0000 (05:26 -0800)
committerDavid S. Miller <davem@nuts.davemloft.net>
Tue, 30 Nov 2004 13:26:12 +0000 (05:26 -0800)
commitedea8fef1415a7499c09149b383a171e83480375
tree6b1d5b3edfcdb2c42e4dcfad91be4110480f6e53
parentd21093c2d5b8d2663c7ae10499119b7cc2ae0308
[UDP]: Select handling of bad checksums.

Alternate workaround for blocking usage of select() by UDP applications.
The problem is Linux optimizes the UDP receive checksum path so that checksum
validation is not performed until the application read. This is a performance win
but can cause applications that do select with blocking file descriptors to get false
positives if the received message has a checksum error.
There is a long running thread about this on LKML.

This patch makes these applications work, but keeps the one-pass performance gain
for those applications smart enough to use non-blocking file descriptors with
select/poll. There is still a possibility to get a false positive if application does
select on non-blocking fd then makes it blocking before doing the receive, but that
is unlikely.

Tested by injecting bad packets with SOCK_RAW.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/udp.h
net/ipv4/af_inet.c
net/ipv4/udp.c
net/ipv6/af_inet6.c