netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Zero checksum in netconsole/netdump packets
@ 2006-11-06 23:40 Chris Lalancette
  2006-11-07  7:16 ` David Miller
  2006-11-07 10:09 ` Gerrit Renker
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Lalancette @ 2006-11-06 23:40 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

Hello,
      I was reading some tcpdump's of netdump traffic today, and I realized that all of the packets that go from the crashing machine to the netdump server have a zero checksum.  Looking at the code, it looks like netconsole/netdump use the function netpoll_send_udp to send out the packets.  However, in netdump_send_udp, the checksum is set to 0, and never seems to be computed.  Is this intentional, or just an oversight?  I would think that we would always want to compute the UDP checksum, but there might be something I am overlooking.  Incidentally, it seems like the only user of netpoll_send_udp is netconsole (and netdump in RedHat kernels).
     Assuming that this is just an oversight, attached is a simple patch to compute the UDP checksum in netpoll_send_udp.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

[-- Attachment #2: linux-2.6.19-rc4-netpoll-udp-checksum.patch --]
[-- Type: text/x-patch, Size: 598 bytes --]

--- linux-2.6/net/core/netpoll.c.orig	2006-11-06 18:16:58.000000000 -0500
+++ linux-2.6/net/core/netpoll.c	2006-11-06 18:31:20.000000000 -0500
@@ -356,6 +356,10 @@ void netpoll_send_udp(struct netpoll *np
 	put_unaligned(htonl(np->remote_ip), &(iph->daddr));
 	iph->check    = ip_fast_csum((unsigned char *)iph, iph->ihl);
 
+	udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, udp_len,
+					IPPROTO_UDP,
+					csum_partial((unsigned char *)udph, udp_len, 0));
+
 	eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
 	skb->mac.raw = skb->data;
 	skb->protocol = eth->h_proto = htons(ETH_P_IP);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-07 22:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-06 23:40 Zero checksum in netconsole/netdump packets Chris Lalancette
2006-11-07  7:16 ` David Miller
2006-11-07 13:33   ` Chris Lalancette
2006-11-07 22:56     ` David Miller
2006-11-07 10:09 ` Gerrit Renker
2006-11-07 11:35   ` Krzysztof Oledzki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).