netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp.com>
To: netdev@vger.kernel.org
Subject: [RFC PATCH] NET: Clone the sk_buff->iif field properly
Date: Wed, 02 Jan 2008 11:01:33 -0500	[thread overview]
Message-ID: <20080102160133.11792.21836.stgit@flek.lan> (raw)

When sk_buffs are cloned the iif field of the new, cloned packet is neither
zeroed out or copied from the existing sk_buff.  The result is that the newly
cloned sk_buff has garbage in the iif field which is a Bad Thing.  This patch
fixes this problem by copying the iif field along with the other sk_buff
critical fields in __copy_skb_header().

This patch is needed by some of the labeled networking changes proposed for
2.6.25, does anyone have any objections?
---

 net/core/skbuff.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 5b4ce9b..9cb7bb7 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -371,6 +371,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
 {
 	new->tstamp		= old->tstamp;
 	new->dev		= old->dev;
+	new->iif		= old->iif;
 	new->transport_header	= old->transport_header;
 	new->network_header	= old->network_header;
 	new->mac_header		= old->mac_header;


             reply	other threads:[~2008-01-02 16:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-02 16:01 Paul Moore [this message]
2008-01-03  9:58 ` [RFC PATCH] NET: Clone the sk_buff->iif field properly Jarek Poplawski
2008-01-03 11:23   ` jamal
2008-01-03 14:01     ` Paul Moore
2008-01-03 16:15     ` Paul Moore
2008-01-03 21:13       ` Jarek Poplawski
2008-01-03 21:20         ` Paul Moore
2008-01-03 22:06           ` Jarek Poplawski
2008-01-03 22:49             ` Jarek Poplawski
2008-01-03 23:05           ` David Miller
2008-01-03 23:13             ` Paul Moore
2008-01-03 23:25               ` David Miller
2008-01-03 23:40               ` Joe Perches
2008-01-04  3:19                 ` Paul Moore
2008-01-04  3:36                   ` David 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=20080102160133.11792.21836.stgit@flek.lan \
    --to=paul.moore@hp.com \
    --cc=netdev@vger.kernel.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 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).