Skip to contentSkip to conversation

don't compare skb->network_header with skb->tail

PATCH In review Hong Zhiguo 2 participants 2 messages Mar 10, 2013

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

PATCH 1/1 don't compare skb->network_header with skb->tail

in the case of NET_SKBUFF_DATA_USES_OFFSET(on 64-bit arch), skb->network_header is just offset over skb->head.

---
 net/core/dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index 90cee5b..378e0b9 100644
@@ -1705,7 +1705,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
 			skb_reset_mac_header(skb2);
 
 			if (skb_network_header(skb2) < skb2->data ||
-			    skb2->network_header > skb2->tail) {
+			    skb_network_header(skb2) > skb2->tail) {
 				net_crit_ratelimited("protocol %04x is buggy, dev %s\n",
 						     ntohs(skb2->protocol),
 						     dev->name);
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 13 lines · Hong Zhiguo

in the case of NET_SKBUFF_DATA_USES_OFFSET(on 64-bit arch), skb->network_header is just offset over skb->head.

---
 net/core/dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +0 -0
index 90cee5b..378e0b9 100644

net/core/dev.c static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) · line 1711

Quoted 8 lines
net/core/dev.c +1 -1
@@ -1705,7 +1705,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
 			skb_reset_mac_header(skb2);
 
 			if (skb_network_header(skb2) < skb2->data ||
-			    skb2->network_header > skb2->tail) {
+			    skb_network_header(skb2) > skb2->tail) {
 				net_crit_ratelimited("protocol %04x is buggy, dev %s\n",
 						     ntohs(skb2->protocol),
 						     dev->name);

Sorry I dont understand this patch.

Could you elaborate ?