Commit 8e365eec authored by Chris Lalancette's avatar Chris Lalancette Committed by David S. Miller

[NETPOLL]: Compute checksum properly in netpoll_send_udp().

Signed-off-by: default avatarChris Lalancette <clalance@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent da33e3eb
...@@ -340,6 +340,12 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) ...@@ -340,6 +340,12 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
udph->dest = htons(np->remote_port); udph->dest = htons(np->remote_port);
udph->len = htons(udp_len); udph->len = htons(udp_len);
udph->check = 0; 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)); skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment