patch-1.3.10 linux/net/ipv4/udp.c
Next file: linux/CREDITS
Previous file: linux/net/ipv4/route.c
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
Thu Jul 13 13:05:10 1995
- Orig file:
v1.3.9/linux/net/ipv4/udp.c
- Orig date:
Fri Jul 7 08:54:57 1995
diff -u --recursive --new-file v1.3.9/linux/net/ipv4/udp.c linux/net/ipv4/udp.c
@@ -45,6 +45,8 @@
* Arnt Gulbrandsen : New udp_send and stuff
* Alan Cox : Cache last socket
* Alan Cox : Route cache
+ * Alan Cox : Checksum precompute is bogus is some lame
+ * software is padding its udp frames in IP!
*
*
* This program is free software; you can redistribute it and/or
@@ -273,7 +275,10 @@
else
a = ip_build_xmit(sk, udp_getfrag, &ufh, ulen,
sin->sin_addr.s_addr, rt, IPPROTO_UDP);
- return(a<0 ? a : len);
+ if(a<0)
+ return a;
+ udp_statistics.UdpOutDatagrams++;
+ return len;
}
@@ -532,6 +537,9 @@
*/
ulen = ntohs(uh->len);
+
+ if(ulen!=len)
+ skb->ip_summed=0; /* Bogoid padded frame */
if (ulen > len || len < sizeof(*uh) || ulen < sizeof(*uh))
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this