From: Bart De Schuymer <bdschuym@pandora.be>
To: Harald Welte <laforge@netfilter.org>
Cc: Linux Netdev List <netdev@vger.kernel.org>,
Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
kaber@trash.net
Subject: Re: [RFC PATCH] convert ebt_ulog to nfnetlink_log
Date: Mon, 08 Aug 2005 06:57:40 +0000 [thread overview]
Message-ID: <1123484260.3686.1.camel@localhost.localdomain> (raw)
In-Reply-To: <20050807213340.GA4508@rama.de.gnumonks.org>
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
next prev parent reply other threads:[~2005-08-08 6:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050730110353.GD6620@rama.de.gnumonks.org>
[not found] ` <20050730.210423.111177162.davem@davemloft.net>
[not found] ` <20050731070509.GD3835@rama.de.gnumonks.org>
[not found] ` <1123241167.3377.15.camel@localhost.localdomain>
[not found] ` <20050805163709.GF4033@rama.de.gnumonks.org>
2005-08-05 17:10 ` [RFC PATCH] convert ebt_ulog to nfnetlink_log Harald Welte
2005-08-07 21:27 ` Bart De Schuymer
2005-08-07 21:33 ` Harald Welte
2005-08-08 6:57 ` Bart De Schuymer [this message]
2005-08-08 8:16 ` Harald Welte
2005-08-08 9:06 bdschuym@pandora.be
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=1123484260.3686.1.camel@localhost.localdomain \
--to=bdschuym@pandora.be \
--cc=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@lists.netfilter.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).