aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorChris Lalancette <clalance@redhat.com>2006-11-07 17:56:19 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-11-07 18:10:13 -0500
commit8e365eec04c86899fab5db0f49a9c98554069bd0 (patch)
treecd271d17c581cb00b03443071612e7660c1728ea /net/core
parentda33e3eb4876c43b78fdc7b7068653239f28714a (diff)
[NETPOLL]: Compute checksum properly in netpoll_send_udp().
Signed-off-by: Chris Lalancette <clalance@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/netpoll.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 9308af060b44..6589adb14cbf 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -340,6 +340,12 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
340 udph->dest = htons(np->remote_port); 340 udph->dest = htons(np->remote_port);
341 udph->len = htons(udp_len); 341 udph->len = htons(udp_len);
342 udph->check = 0; 342 udph->check = 0;
343 udph->check = csum_tcpudp_magic(htonl(np->local_ip),
344 htonl(np->remote_ip),
345 udp_len, IPPROTO_UDP,
346 csum_partial((unsigned char *)udph, udp_len, 0));
347 if (udph->check == 0)
348 udph->check = -1;
343 349
344 skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph)); 350 skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
345 351