netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Chazarain <guichaz@yahoo.fr>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: chas3@users.sourceforge.net, David Miller <davem@davemloft.net>,
	shemminger@osdl.org, netdev@vger.kernel.org,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Subject: Re: [PATCH] clear skb cb on IP input
Date: Wed, 19 Jul 2006 14:35:15 +0200	[thread overview]
Message-ID: <44BE2703.8060907@yahoo.fr> (raw)
In-Reply-To: <20060718194318.GA15572@gondor.apana.org.au>

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

Herbert Xu wrote :
> Probably. Patches are welcome :)
Here are they, in both case I checked that the stuff to clear
was not already cleared, but I could not produce any misbehavior
by writing random junk instead of clearing the data. All my tests
were on the loopback using UML.

For IPv4, the added safety seems worth, but for IPv6 it's less clear.

Thanks.

-- 
Guillaume


[-- Attachment #2: clear_ip6cb.diff --]
[-- Type: text/x-patch, Size: 489 bytes --]

Clear the accumulated junk in IP6CB when starting to handle an
IPV6 packet.

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
---

 ip6_input.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -70,6 +70,8 @@ int ipv6_rcv(struct sk_buff *skb, struct
 		IP6_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 		goto out;
 	}
+
+	memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
 
 	/*
 	 * Store incoming device index. When the packet will


[-- Attachment #3: clear_whole_ipcb.diff --]
[-- Type: text/x-patch, Size: 563 bytes --]

Clear the whole IPCB, this clears also IPCB(skb)->flags.

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
---

 ip_input.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -429,7 +429,7 @@ int ip_rcv(struct sk_buff *skb, struct n
 	}
 
 	/* Remove any debris in the socket control block */
-	memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
+	memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
 
 	return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL,
 		       ip_rcv_finish);


  reply	other threads:[~2006-07-19 12:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-14 14:34 Netem does not work with loopback Guillaume Chazarain
2006-07-14 15:38 ` Stephen Hemminger
2006-07-14 17:04   ` Guillaume Chazarain
2006-07-14 18:39     ` Stephen Hemminger
2006-07-14 18:49       ` Guillaume Chazarain
2006-07-14 18:56         ` [PATCH] clear skb cb on IP input Stephen Hemminger
2006-07-14 21:48           ` David Miller
2006-07-15 13:28             ` Herbert Xu
2006-07-15 15:50               ` Stephen Hemminger
2006-07-16  1:15                 ` David Miller
2006-07-16  1:12               ` David Miller
2006-07-16 11:20                 ` chas williams - CONTRACTOR
2006-07-17  2:02                   ` David Miller
2006-07-18 18:19                   ` Guillaume Chazarain
2006-07-18 19:43                     ` Herbert Xu
2006-07-19 12:35                       ` Guillaume Chazarain [this message]
2006-07-25  6:45                         ` David Miller
2006-07-16 22:03                 ` Herbert Xu
2006-07-17  1:18                   ` 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=44BE2703.8060907@yahoo.fr \
    --to=guichaz@yahoo.fr \
    --cc=chas3@users.sourceforge.net \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    --cc=yoshfuji@linux-ipv6.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).