netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] net: fix a wrong assignment in skb_split()
@ 2013-02-20  8:51 Cong Wang
  2013-02-20 18:42 ` Pravin Shelar
  0 siblings, 1 reply; 4+ messages in thread
From: Cong Wang @ 2013-02-20  8:51 UTC (permalink / raw)
  To: netdev; +Cc: Pravin B Shelar, David S. Miller, 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.

Cc: Pravin B Shelar <pshelar@nicira.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 2a3ca33..33245ef 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -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. */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch] net: fix a wrong assignment in skb_split()
  2013-02-20  8:51 [Patch] net: fix a wrong assignment in skb_split() Cong Wang
@ 2013-02-20 18:42 ` Pravin Shelar
  2013-02-20 20:13   ` David Miller
  2013-02-20 21:32   ` Greg Rose
  0 siblings, 2 replies; 4+ messages in thread
From: Pravin Shelar @ 2013-02-20 18:42 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, David S. Miller

On Wed, Feb 20, 2013 at 12:51 AM, Cong Wang <amwang@redhat.com> wrote:
> 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 <pshelar@nicira.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
>
Looks good.

Acked-by: Pravin B Shelar <pshelar@nicira.com>

> ---
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 2a3ca33..33245ef 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -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. */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] net: fix a wrong assignment in skb_split()
  2013-02-20 18:42 ` Pravin Shelar
@ 2013-02-20 20:13   ` David Miller
  2013-02-20 21:32   ` Greg Rose
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2013-02-20 20:13 UTC (permalink / raw)
  To: pshelar; +Cc: amwang, netdev

From: Pravin Shelar <pshelar@nicira.com>
Date: Wed, 20 Feb 2013 10:42:18 -0800

> On Wed, Feb 20, 2013 at 12:51 AM, Cong Wang <amwang@redhat.com> wrote:
>> 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 <pshelar@nicira.com>
>> Cc: David S. Miller <davem@davemloft.net>
>> Signed-off-by: Cong Wang <amwang@redhat.com>
>>
> Looks good.
> 
> Acked-by: Pravin B Shelar <pshelar@nicira.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] net: fix a wrong assignment in skb_split()
  2013-02-20 18:42 ` Pravin Shelar
  2013-02-20 20:13   ` David Miller
@ 2013-02-20 21:32   ` Greg Rose
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Rose @ 2013-02-20 21:32 UTC (permalink / raw)
  To: Pravin Shelar; +Cc: Cong Wang, netdev, David S. Miller

On Wed, 20 Feb 2013 10:42:18 -0800
Pravin Shelar <pshelar@nicira.com> wrote:

> On Wed, Feb 20, 2013 at 12:51 AM, Cong Wang <amwang@redhat.com> wrote:
> > 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

> >
> > Cc: Pravin B Shelar <pshelar@nicira.com>
> > Cc: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Cong Wang <amwang@redhat.com>
> >
> Looks good.
> 
> Acked-by: Pravin B Shelar <pshelar@nicira.com>
> 
> > ---
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index 2a3ca33..33245ef 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -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. */
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-20 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20  8:51 [Patch] net: fix a wrong assignment in skb_split() Cong Wang
2013-02-20 18:42 ` Pravin Shelar
2013-02-20 20:13   ` David Miller
2013-02-20 21:32   ` Greg Rose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).