Pablo Neira Ayuso
2017-Mar-15 18:15 UTC
[Bridge] [PATCH net] bridge: ebtables: fix reception of frames DNAT-ed to bridge device
On Wed, Mar 15, 2017 at 03:27:20PM +0100, Linus L?ssing wrote:> On Wed, Mar 15, 2017 at 11:42:11AM +0100, Pablo Neira Ayuso wrote: > > I'm missing then why redirect is not then just enough for Linus usecase. > > For my usecase, the MAC address is configured by the user from a > Web-UI. It may or may not be the one from the bridge device. > > Besides, found it counter intuitive that DNAT did not work here > and took me some time to find out why. At least I didn't read about > any such known limitations of the dnat target in the ebtables > manpage.Could you update ebtables dnat to check if the ethernet address matches the one of the input bridge interface, so we mangle the ->pkt_type accordingly from there, instead of doing this from the core?
Linus Lüssing
2017-Mar-15 21:16 UTC
[Bridge] [PATCH net] bridge: ebtables: fix reception of frames DNAT-ed to bridge device
On Wed, Mar 15, 2017 at 07:15:39PM +0100, Pablo Neira Ayuso wrote:> Could you update ebtables dnat to check if the ethernet address > matches the one of the input bridge interface, so we mangle the > ->pkt_type accordingly from there, instead of doing this from the > core?Actually, that was the approach I thought about and went for first (and it would probably work for me). Just checking against the bridge device's net_device::dev_addr. I scratched it though, as I was afraid that the issue might still exist for people using some other upper device on top of the bridge device. For instance, macvlan? And iterating over the net_device::dev_addrs list seemed too costly for fast path to me.