From: Chris Lalancette Date: Tue, 7 Nov 2006 22:56:19 +0000 (-0800) Subject: [NETPOLL]: Compute checksum properly in netpoll_send_udp(). X-Git-Tag: v3.12-rc1~31920^2~20^2~177^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e365eec04c86899fab5db0f49a9c98554069bd0;p=kernel%2Fkernel-generic.git [NETPOLL]: Compute checksum properly in netpoll_send_udp(). Signed-off-by: Chris Lalancette Signed-off-by: David S. Miller --- diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 9308af0..6589adb 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) udph->dest = htons(np->remote_port); udph->len = htons(udp_len); udph->check = 0; + udph->check = csum_tcpudp_magic(htonl(np->local_ip), + htonl(np->remote_ip), + udp_len, IPPROTO_UDP, + csum_partial((unsigned char *)udph, udp_len, 0)); + if (udph->check == 0) + udph->check = -1; skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));