Subject: Re: [PATCH 2/3] [VLAN]: Update iif when receiving via VLAN device

From: Thomas Graf <[email-masked]>
Date: Fri, 30 Jun 2006 02:46:40 +0200

* jamal <[email-masked]> 2006-06-29 20:03
> On Fri, 2006-30-06 at 01:39 +0200, Thomas Graf wrote:
> > * jamal <[email-masked]> 2006-06-29 19:23
> 
> > > not at all. Let me explain the design intent further below.
> > 
> > Then let me show you what your code does:
> > 
> >  [mirred attached to filter on eth0 redirecting to ifb0]
> > 
> > tcf_mirred():    skb2->input_dev = skb->dev; (skb2->input_dev=eth0)
> > ifb_xmit():      skb->dev = skb->input_dev; (skb->dev=eth0)
> >                  skb->input_dev = dev; (skb->input_dev=ifb0)
> > 
> > So when reentering the stack the skb looks like it would be
> > on eth0 coming from ifb0. Is that what you wanted? 
> 
> ok, that looks like egress side of the stack, correct?

No, that's the ingress side leaving ifb again via netif_rx()
skb->dev should represent the from/at= and not to=. 

For egress your code is correct although impossible to guess
right due to total lack of a comment where it would make sense
and naming that doesn't give any implications.

When leaving ifb0 you want for...
... egress:
   skb->dev=to (eth0) skb->iif=from (ifb0)
... ingress:
   skb->dev=at (ifb0) skb->iif=from (eth0)

So we move the update to the tasklet and set skb->dev to
skb->iif before dev_queue_xmit() and skb->dev = dev (ifb)
before calling netif_rx()

Does that fullfil your requirements?