netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re:  [RFC PATCH] convert ebt_ulog to nfnetlink_log
@ 2005-08-08  9:06 bdschuym@pandora.be
  0 siblings, 0 replies; 6+ messages in thread
From: bdschuym@pandora.be @ 2005-08-08  9:06 UTC (permalink / raw)
  To: Harald Welte; +Cc: Linux Netdev List, Netfilter Development Mailinglist

(using webmail)

>----- Oorspronkelijk bericht -----
>Van: Harald Welte [mailto:laforge@netfilter.org]
>Ok, so this is actually the opposite problem of the ipt_physdev.c
>problem.  Here we have the physical device, but not the bridge group.
>
>This means we have to handle two separate cases:
>
>1) when nf_log_packet() gets called from the bridging code
>	indev == eth0
>	outdev == eth1
>		-> we need to resolve br0 from dev->br_port member
>
>2) when nf_log_packet() gets called from the ipv4 code:
>	indev == br0
>	outdev == br0
>		-> we need to resolve ethX from skb->nf_bridge member
>
>If I'm now correct, what about the following [reverse] patch (also
>attached the whole resulting file for your reference, since you don't
>have access to the tree).

There is one case missing: the brouter case. If br0=eth0+eth1 and a packet arrives at eth0 (not br0) in the IP code (not the bridge code), then the indev must be eth0, not br0.
How about something like this?

if (pf == PF_BRIDGE) { /* Called from ebtables */
	NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSINDEV,
		sizeof(tmp_uint), &tmp_uint);
	tmp_uint = htonl(indev->br_port->br->dev->ifindex);
	NFA_PUT(inst->skb, NFULA_IFINDEX_INDEV,
		sizeof(tmp_uint), &tmp_uint);
} else {
	NFA_PUT(inst->skb, NFULA_IFINDEX_INDEV,
		sizeof(tmp_uint), &tmp_uint);

	if (skb->nf_bridge && skb->nf_bridge->physindev)
		/* Called inside bridge code, but not from ebtables. */
		tmp_uint = htonl(skb->nf_bridge->physindev->ifindex);
	NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSINDEV,
		sizeof(tmp_uint), &tmp_uint);
}

cheers,
Bart

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-08  9:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2005-08-08  8:16                 ` Harald Welte
2005-08-08  9:06 bdschuym@pandora.be

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).