Skip to contentSkip to conversation

net: fix a wrong assignment in skb_split()

PATCH Applied Cong Wang 4 participants 4 messages Feb 20, 2013

Subsystems (2)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

PATCH 1/1 net: fix a wrong assignment in skb_split()

commit c9af6db4c11ccc6c3e7f1 (net: Fix possible wrong checksum generation) has a suspicous piece:

- skb_shinfo(skb1)->gso_type = skb_shinfo(skb)->gso_type;
-
+ skb_shinfo(skb)->tx_flags = skb_shinfo(skb1)->tx_flags & SKBTX_SHARED_FRAG;

skb1 is the new skb, therefore should be on the left side of the assignment. This patch fixes it.

Cc Pravin B Shelar <[email protected]>
Cc David S. Miller <[email protected]>

---

net/core/skbuff.c +1 -1
index 2a3ca33..33245ef 100644
@@ -2326,7 +2326,7 @@ void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len)
 {
 	int pos = skb_headlen(skb);
 
-	skb_shinfo(skb)->tx_flags = skb_shinfo(skb1)->tx_flags & SKBTX_SHARED_FRAG;
+	skb_shinfo(skb1)->tx_flags = skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG;
 	if (len < pos)	/* Split line is inside header. */
 		skb_split_inside_header(skb, skb1, len, pos);
 	else		/* Second chunk has no header, nothing to copy. */
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Cong Wang

commit c9af6db4c11ccc6c3e7f1 (net: Fix possible wrong checksum generation) has a suspicous piece:

- skb_shinfo(skb1)->gso_type = skb_shinfo(skb)->gso_type;
-
+ skb_shinfo(skb)->tx_flags = skb_shinfo(skb1)->tx_flags & SKBTX_SHARED_FRAG;

Quoted 7 lines

skb1 is the new skb, therefore should be on the left side of the assignment. This patch fixes it.

Cc Pravin B Shelar <[email protected]>
Cc David S. Miller <[email protected]>

Looks good.

Quoted 14 lines

---

net/core/skbuff.c +1 -1
index 2a3ca33..33245ef 100644
@@ -2326,7 +2326,7 @@ void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len)
 {
        int pos = skb_headlen(skb);
 
-       skb_shinfo(skb)->tx_flags = skb_shinfo(skb1)->tx_flags & SKBTX_SHARED_FRAG;
+       skb_shinfo(skb1)->tx_flags = skb_shinfo(skb)->tx_flags & SKBTX_SHARED_FRAG;
        if (len < pos)  /* Split line is inside header. */
                skb_split_inside_header(skb, skb1, len, pos);
        else            /* Second chunk has no header, nothing to copy. */
maintainer Applied
#2 lore raw

From: Pravin Shelar <[email protected]>
Date: Wed, 20 Feb 2013 10:42:18 -0800

Quoted 11 lines · Cong Wang
Quoted 10 lines

commit c9af6db4c11ccc6c3e7f1 (net: Fix possible wrong checksum generation) has a suspicous piece:

- skb_shinfo(skb1)->gso_type = skb_shinfo(skb)->gso_type;
-
+ skb_shinfo(skb)->tx_flags = skb_shinfo(skb1)->tx_flags & SKBTX_SHARED_FRAG;

skb1 is the new skb, therefore should be on the left side of the assignment. This patch fixes it.

Quoted 7 lines
Quoted 4 lines
Cc Pravin B Shelar <[email protected]>
Cc David S. Miller <[email protected]>

Looks good.

Applied, thanks.

#3 lore raw
In reply to Pravin Shelar
Quoted 11 lines · On Wed, 20 Feb 2013 10:42:18 -0800 Pravin Shelar <[email protected]> wrote:
Quoted 10 lines · Cong Wang

commit c9af6db4c11ccc6c3e7f1 (net: Fix possible wrong checksum generation) has a suspicous piece:

- skb_shinfo(skb1)->gso_type =
skb_shinfo(skb)->gso_type; -
+ skb_shinfo(skb)->tx_flags =
skb_shinfo(skb1)->tx_flags & SKBTX_SHARED_FRAG;

skb1 is the new skb, therefore should be on the left side of the assignment. This patch fixes it.

It looks to me like skb1 is on the right side of the assignment?

- Greg

Quoted 29 lines
Quoted 5 lines
Cc Pravin B Shelar <[email protected]>
Cc David S. Miller <[email protected]>

Looks good.

Quoted 12 lines

---

net/core/skbuff.c +1 -1
index 2a3ca33..33245ef 100644
@@ -2326,7 +2326,7 @@ void skb_split(struct sk_buff *skb, struct
 sk_buff *skb1, const u32 len) {
        int pos = skb_headlen(skb);
 
-       skb_shinfo(skb)->tx_flags = skb_shinfo(skb1)->tx_flags &
 SKBTX_SHARED_FRAG;
+       skb_shinfo(skb1)->tx_flags = skb_shinfo(skb)->tx_flags &
Quoted 4 lines

SKBTX_SHARED_FRAG; if (len < pos) /* Split line is inside header. */ skb_split_inside_header(skb, skb1, len, pos);
else /* Second chunk has no header, nothing to
copy. */

--
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