Op zo, 07-08-2005 te 23:33 +0200, schreef Harald Welte: 
> > indev->br_port->br->dev->ifindex points to the ifindex of the bridge br0
> > when indev is a bridge port (eth0). So you need this to fill in the
> > input device (assuming we agree that the bridge is called the input
> > device, and the bridge port is called the physical input device).
> > Filling in the physical input device is done with indev (in case
> > indev->br_port is not NULL).
> 
> I'm not sure if I can follow you.  What basically happens is:
> 
> ebt_ulog calls nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, ...) where
> "in" and "out" are struct net_device as passed to the ebt_ulog function
> (which is part of the ebt_watcher).  
> 
> [...]
> 
> the code ends up at the function you are quoting above.  "indev"
> is "in" and "outdev" is "out", transparently passed from
> nf_log_packet().
> 
> So I think it should reflect exactly what you currently do in ebt_ulog.
> The only diference is that you now get the ifindex and not the device
> name string.

ebt_ulog code snippet:
strcpy(pm->physindev, in->name);
/* If in isn't a bridge, then physindev==indev */
if (in->br_port)
strcpy(pm->indev, in->br_port->br->dev->name);
else
strcpy(pm->indev, in->name);

Your code snippet:
if (indev->br_port) {
tmp_uint = htonl(indev->br_port->br->dev->ifindex);
NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSINDEV,
        sizeof(tmp_uint), &tmp_uint);
}

These two code fragments do not do the same thing. If indev is a bridge
port (meaning indev->br_port != NULL), then the NFULA_IFINDEX_PHYSINDEV
must be indev, while the NFULA_IFINDEX_INDEV must be in->br_port->br-
>dev->name.
If indev is not a bridge port, the ebt_ulog code makes
NFULA_IFINDEX_PHYSINDEV and NFULA_IFINDEX_INDEV the same (indev).

cheers,
Bart


-
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

Reply via email to