All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Tommy Christensen <tommy.christensen@tpack.net>
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] Handle shared SKBs in VLAN receive code
Date: Fri, 10 Oct 2003 16:52:43 -0700	[thread overview]
Message-ID: <3F87464B.1020908@candelatech.com> (raw)
In-Reply-To: <3F87430D.2040000@tpack.net>

Tommy Christensen wrote:
> As noted by Jonas Munsin, the vlan patch that went into 2.6.0-test7 did a
> kfree() rather than a kfree_skb(). Hmm.
> 
> Instead of just fixing this up, I suggest we do things the right way:
> 
> The VLAN code have long been claiming to handle shared SKBs, without 
> actually
> doing so. I have now added the call to skb_share_check().
> 
> This enables us to simply do a skb_unshare() when mangling the ethernet 
> header.
> 
> 
> Patch is against linux-2.6.0-test7 (applies to 2.4.23-pre7 as well).
> 
> -Tommy
> 
> 
> ------------------------------------------------------------------------
> 
> diff -ru linux-2.6.0-test7/net/8021q/vlan_dev.c linux-2.6/net/8021q/vlan_dev.c
> --- linux-2.6.0-test7/net/8021q/vlan_dev.c	Wed Oct  8 21:24:44 2003
> +++ linux-2.6/net/8021q/vlan_dev.c	Sat Oct 11 00:45:28 2003
> @@ -74,11 +74,7 @@
>  static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
>  {
>  	if (VLAN_DEV_INFO(skb->dev)->flags & 1) {
> -		if (skb_shared(skb) || skb_cloned(skb)) {
> -			struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
> -			kfree(skb);
> -			skb = nskb;
> -		}
> +		skb = skb_unshare(skb, GFP_ATOMIC);

On 2.4.22, at least, skb_unshare only checks skb_cloned(), so do we
also need to check skb_shared()?  Or was that check in the old patch above
not needed?

Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

  reply	other threads:[~2003-10-10 23:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10 23:38 [PATCH] Handle shared SKBs in VLAN receive code Tommy Christensen
2003-10-10 23:52 ` Ben Greear [this message]
2003-10-11  0:09   ` Tommy Christensen
2003-10-11 19:03     ` Ben Greear
2003-10-11 19:03       ` David S. Miller
2003-10-11 19:55         ` Ben Greear
2003-10-11 19:54           ` David S. Miller
2003-10-12 10:00         ` Tommy Christensen
2003-10-13 17:19           ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F87464B.1020908@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=netdev@oss.sgi.com \
    --cc=tommy.christensen@tpack.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.