diff options
author | Chris Lalancette <clalance@redhat.com> | 2006-11-07 23:56:19 +0100 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-11-08 00:10:13 +0100 |
commit | 8e365eec04c86899fab5db0f49a9c98554069bd0 (patch) | |
tree | cd271d17c581cb00b03443071612e7660c1728ea | |
parent | [PKT_SCHED] sch_htb: Use hlist_del_init(). (diff) | |
download | linux-8e365eec04c86899fab5db0f49a9c98554069bd0.tar.xz linux-8e365eec04c86899fab5db0f49a9c98554069bd0.zip |
[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>
-rw-r--r-- | net/core/netpoll.c | 6 |
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) 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)); |