On Fri, 14 Jul 2006 19:04:01 +0200 Guillaume Chazarain <[EMAIL PROTECTED]> wrote:
> 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. > No, the correct fix is to make IP input not accept any options from the device. Does this work? diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index e1a7dba..184c78c 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -428,6 +428,9 @@ int ip_rcv(struct sk_buff *skb, struct n goto drop; } + /* Remove any debris in the socket control block */ + memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); + return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL, ip_rcv_finish); - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html