Re: [PATCH 1/3] netpoll: initialize skb for UDP

2006-10-20 Thread David Miller
From: Stephen Hemminger [EMAIL PROTECTED]
Date: Thu, 19 Oct 2006 10:15:42 -0700

 Need to fully initialize skb to keep lower layers and queueing happy.
 
 Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]

Applied, thanks Stephen.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] netpoll: initialize skb for UDP

2006-10-19 Thread Stephen Hemminger
Need to fully initialize skb to keep lower layers and queueing happy.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]

--- linux-2.6.orig/net/core/netpoll.c   2006-10-18 15:26:36.0 -0700
+++ linux-2.6/net/core/netpoll.c2006-10-19 08:28:04.0 -0700
@@ -331,13 +331,13 @@
memcpy(skb-data, msg, len);
skb-len += len;
 
-   udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
+   skb-h.uh = udph = (struct udphdr *) skb_push(skb, sizeof(*udph));
udph-source = htons(np-local_port);
udph-dest = htons(np-remote_port);
udph-len = htons(udp_len);
udph-check = 0;
 
-   iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
+   skb-nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
 
/* iph-version = 4; iph-ihl = 5; */
put_unaligned(0x45, (unsigned char *)iph);
@@ -353,8 +353,8 @@
iph-check= ip_fast_csum((unsigned char *)iph, iph-ihl);
 
eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
-
-   eth-h_proto = htons(ETH_P_IP);
+   skb-mac.raw = skb-data;
+   skb-protocol = eth-h_proto = htons(ETH_P_IP);
memcpy(eth-h_source, np-local_mac, 6);
memcpy(eth-h_dest, np-remote_mac, 6);
 

--

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html