Skip to contentSkip to conversation

PATCH: [SKBUFF] remove some ethernet header related magic numbers

PATCH Arnaldo Carvalho de Melo 1 participant 1 message Oct 5, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi David,

Plesase consider pulling from:

bk://kernel.bkbits.net/acme/sk_buff-2.6

Now there are twelve outstanding changesets in this
tree.

Best Regards,

- Arnaldo

===================================================================

[email protected], 2004-10-05 15:45:31-03:00, [email protected]
[SKBUFF] remove some ethernet header related magic numbers

 drivers/net/loopback.c |    2 +-
 net/core/pktgen.c      |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/loopback.c +1 -1
diff -Nru a/drivers/net/loopback.c b/drivers/net/loopback.c
@@ -85,7 +85,7 @@
 		if (!nskb)
 			break;
 		skb_reserve(nskb, 32);
-		nskb->mac.raw = nskb->data - 14;
+		nskb->mac.raw = nskb->data - ETH_HLEN;
 		nskb->nh.raw = nskb->data;
 		iph = nskb->nh.iph;
 		memcpy(nskb->data, skb->nh.raw, doffset);
net/core/pktgen.c +2 -2
diff -Nru a/net/core/pktgen.c b/net/core/pktgen.c
@@ -515,8 +515,8 @@
 	iph->tot_len = htons(iplen);
 	iph->check = 0;
 	iph->check = ip_fast_csum((void *) iph, iph->ihl);
-	skb->protocol = __constant_htons(ETH_P_IP);
-	skb->mac.raw = ((u8 *)iph) - 14;
+	skb->protocol = htons(ETH_P_IP);
+	skb->mac.raw = ((u8 *)iph) - ETH_ALEN;
 	skb->dev = odev;
 	skb->pkt_type = PACKET_HOST;
 

===================================================================