diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-10-20 02:58:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-10-20 02:58:23 -0400 |
commit | 206daaf77f68ce0f103164e6406336068c87a4a5 (patch) | |
tree | 2b94da1198266758a4f027ec9f88784c390b655a /net | |
parent | 6723ab549df777742801716d7aeea397e6e97f2c (diff) |
[NETPOLL]: initialize skb for UDP
Need to fully initialize skb to keep lower layers and queueing happy.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/netpoll.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index ead5920c26d6..9308af060b44 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -335,13 +335,13 @@ 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 | 343 | ||
344 | iph = (struct iphdr *)skb_push(skb, sizeof(*iph)); | 344 | skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph)); |
345 | 345 | ||
346 | /* iph->version = 4; iph->ihl = 5; */ | 346 | /* iph->version = 4; iph->ihl = 5; */ |
347 | put_unaligned(0x45, (unsigned char *)iph); | 347 | put_unaligned(0x45, (unsigned char *)iph); |
@@ -357,8 +357,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
357 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | 357 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); |
358 | 358 | ||
359 | eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); | 359 | eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); |
360 | 360 | skb->mac.raw = skb->data; | |
361 | eth->h_proto = htons(ETH_P_IP); | 361 | skb->protocol = eth->h_proto = htons(ETH_P_IP); |
362 | memcpy(eth->h_source, np->local_mac, 6); | 362 | memcpy(eth->h_source, np->local_mac, 6); |
363 | memcpy(eth->h_dest, np->remote_mac, 6); | 363 | memcpy(eth->h_dest, np->remote_mac, 6); |
364 | 364 | ||