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
  2005-08-08 13:24 ` [PATCH] add bridging support to nfnetlink_{log,queue} Harald Welte
  0 siblings, 1 reply; 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-09  6:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-08  9:06 [RFC PATCH] convert ebt_ulog to nfnetlink_log bdschuym@pandora.be
2005-08-08 13:24 ` [PATCH] add bridging support to nfnetlink_{log,queue} Harald Welte
2005-08-08 17:43   ` Bart De Schuymer
2005-08-08 17:36     ` Harald Welte
2005-08-09  6:54       ` Bart De Schuymer
2005-08-09  0:00   ` David S. Miller

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