All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Sundberg <marcus@ingate.com>
To: netfilter-devel@lists.netfilter.org, linux-net@vger.kernel.org
Subject: Dealing with shared/cloned skbs?
Date: Tue, 23 Aug 2005 17:07:00 +0200	[thread overview]
Message-ID: <430B3B94.8060902@ingate.com> (raw)

Hi,

in the 2.4 net/ipv4/netfilter directory various ways are used to
check whether an skb needs to be copied before it is modified. At
least three ways are used:

if (skb_shared(skb) || skb_cloned(skb))

if (skb_cloned(skb) && !skb->sk)

if (skb_cloned(skb))

And at the places where the skb is actually copied some of them do:

	if ((oldskb)->sk)
		skb_set_owner_w(newskb, oldskb->sk);

while some of them do not.

What is the correct way to know if an skb needs to be copied before
modified, and what should be done after a copy takes place?

//Marcus
-- 
---------------------------------------+--------------------------
   Marcus Sundberg <marcus@ingate.com>  | Firewalls with SIP & NAT
  Software Developer, Ingate Systems AB |  http://www.ingate.com/

                 reply	other threads:[~2005-08-23 15:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=430B3B94.8060902@ingate.com \
    --to=marcus@ingate.com \
    --cc=linux-net@vger.kernel.org \
    --cc=netfilter-devel@lists.netfilter.org \
    /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.