Skip to contentSkip to conversation

skb->tail can be offset

PATCH In review Serge E. Hallyn 2 participants 2 messages Feb 15, 2010 – Feb 16, 2010 1 message not in the archive Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skb->tail can be offset

Needed for socket c/r on 64-bit arches.

---
 net/checkpoint.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/checkpoint.c +2 -2
index c6b6341..ee13050 100644
@@ -97,19 +97,19 @@ static void sock_record_header_info(struct sk_buff *skb,
 	h->mac_len = skb->mac_len;
 	h->skb_len = skb->len;
 	h->hdr_len = skb->data - skb->head;
-	h->lin_len = ((unsigned long)skb->tail - (unsigned long)skb->head);
 	h->frg_len = skb->data_len;
-
 	h->data_offset = (skb->data - skb->head);
 
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
 	h->transport_header = skb->transport_header;
 	h->network_header = skb->network_header;
 	h->mac_header = skb->mac_header;
+	h->lin_len = (unsigned long) skb->tail;
 #else
 	h->transport_header = skb->transport_header - skb->head;
 	h->network_header = skb->network_header - skb->head;
 	h->mac_header = skb->mac_header - skb->head;
+	h->lin_len = ((unsigned long) skb->tail - (unsigned long) skb->head);
 #endif
 
 	memcpy(h->cb, skb->cb, sizeof(skb->cb));
Signature · 1 line
1.6.0.6

A message that is not in the archive (sent off-list or not yet received): 20100215221214.GA21108-r/[email protected]

#2 lore raw

Nice catch -- applied.

Quoted 33 lines · Serge E. Hallyn

Needed for socket c/r on 64-bit arches.

---
 net/checkpoint.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/checkpoint.c +2 -2
index c6b6341..ee13050 100644
@@ -97,19 +97,19 @@ static void sock_record_header_info(struct sk_buff *skb,
 	h->mac_len = skb->mac_len;
 	h->skb_len = skb->len;
 	h->hdr_len = skb->data - skb->head;
-	h->lin_len = ((unsigned long)skb->tail - (unsigned long)skb->head);
 	h->frg_len = skb->data_len;
-
 	h->data_offset = (skb->data - skb->head);
 
 #ifdef NET_SKBUFF_DATA_USES_OFFSET
 	h->transport_header = skb->transport_header;
 	h->network_header = skb->network_header;
 	h->mac_header = skb->mac_header;
+	h->lin_len = (unsigned long) skb->tail;
 #else
 	h->transport_header = skb->transport_header - skb->head;
 	h->network_header = skb->network_header - skb->head;
 	h->mac_header = skb->mac_header - skb->head;
+	h->lin_len = ((unsigned long) skb->tail - (unsigned long) skb->head);
 #endif
 
 	memcpy(h->cb, skb->cb, sizeof(skb->cb));