aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/netpoll.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:06:44 -0500
commit0bd2af46839ad6262d25714a6ec0365db9d6b98f (patch)
treedcced72d230d69fd0c5816ac6dd03ab84799a93e /net/core/netpoll.c
parente138a5d2356729b8752e88520cc1525fae9794ac (diff)
parentf26b90440cd74c78fe10c9bd5160809704a9627c (diff)
Merge ../scsi-rc-fixes-2.6
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r--net/core/netpoll.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index ead5920c26d6..6589adb14cbf 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -335,13 +335,19 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
335 memcpy(skb->data, msg, len); 335 memcpy(skb->data, msg, len);
336 skb->len += len; 336 skb->len += len;
337 337
338 udph = (struct udphdr *) skb_push(skb, sizeof(*udph)); 338 skb->h.uh = udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
339 udph->source = htons(np->local_port); 339 udph->source = htons(np->local_port);
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 iph = (struct iphdr *)skb_push(skb, sizeof(*iph)); 350 skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
345 351
346 /* iph->version = 4; iph->ihl = 5; */ 352 /* iph->version = 4; iph->ihl = 5; */
347 put_unaligned(0x45, (unsigned char *)iph); 353 put_unaligned(0x45, (unsigned char *)iph);
@@ -357,8 +363,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
357 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); 363 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
358 364
359 eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); 365 eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
360 366 skb->mac.raw = skb->data;
361 eth->h_proto = htons(ETH_P_IP); 367 skb->protocol = eth->h_proto = htons(ETH_P_IP);
362 memcpy(eth->h_source, np->local_mac, 6); 368 memcpy(eth->h_source, np->local_mac, 6);
363 memcpy(eth->h_dest, np->remote_mac, 6); 369 memcpy(eth->h_dest, np->remote_mac, 6);
364 370