netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Chazarain <guichaz@yahoo.fr>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: netdev@vger.kernel.org
Subject: Re: Netem does not work with loopback
Date: Fri, 14 Jul 2006 19:04:01 +0200	[thread overview]
Message-ID: <44B7CE81.8020800@yahoo.fr> (raw)
In-Reply-To: <20060714083847.6997a460@localhost.localdomain>

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

Stephen Hemminger wrote :
> Isn't the skb owned by netem at that point...
>   
Thank you, that makes sense to me.
But then the loopback device reinjects the skb without cleaning skb->cb.

The attached patch solves the problem for me (netem on lo). Maybe the
correct solution would be to make a skb->destructor function for netem,
but I am not sure this is the intended use of a destructor function.

Thanks.

-- 
Guillaume


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

--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -156,6 +156,9 @@
 	lb_stats->tx_packets = lb_stats->rx_packets;
 	put_cpu();
 
+	/* Get rid of all the private data accumulated in the sending part */
+	memset(skb->cb, 0, sizeof(skb->cb));
+
 	netif_rx(skb);
 
 	return(0);

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

  reply	other threads:[~2006-07-14 17:03 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 [this message]
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
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=44B7CE81.8020800@yahoo.fr \
    --to=guichaz@yahoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.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).