* [iptables PATCH] ebtables: Include 'bitmask' value when comparing rules
@ 2024-06-12 12:41 Phil Sutter
2024-06-12 20:45 ` Phil Sutter
0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2024-06-12 12:41 UTC (permalink / raw)
To: netfilter-devel; +Cc: Michael Estner
The former FIXME comment pointed at the fact that struct ebt_entry does
not have a 'flags' field (unlike struct ipt_ip). In fact, ebt_entry's
equivalent is 'bitmask' field. Comparing that instead is the right
thing to do, even though it does not seem to make a difference in
practice: No rule options alter just the bitmask value, nor is it
possible to fill an associated field with default values (e.g. all-zero
MAC and mask).
Since the situation described above might change and there is a slight
performance improvement in some cases (e.g. comparing rules differing
only by specified/omitted source/dest MAC address), add the check
anyway.
Suggested-by: Michael Estner <michaelestner@web.de>
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
iptables/nft-bridge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/iptables/nft-bridge.c b/iptables/nft-bridge.c
index 922ce98385400..f4a3c69ac1660 100644
--- a/iptables/nft-bridge.c
+++ b/iptables/nft-bridge.c
@@ -373,9 +373,9 @@ static bool nft_bridge_is_same(const struct iptables_command_state *cs_a,
int i;
if (a->ethproto != b->ethproto ||
- /* FIXME: a->flags != b->flags || */
+ a->bitmask != b->bitmask ||
a->invflags != b->invflags) {
- DEBUGP("different proto/flags/invflags\n");
+ DEBUGP("different proto/bitmask/invflags\n");
return false;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [iptables PATCH] ebtables: Include 'bitmask' value when comparing rules
2024-06-12 12:41 [iptables PATCH] ebtables: Include 'bitmask' value when comparing rules Phil Sutter
@ 2024-06-12 20:45 ` Phil Sutter
0 siblings, 0 replies; 2+ messages in thread
From: Phil Sutter @ 2024-06-12 20:45 UTC (permalink / raw)
To: netfilter-devel; +Cc: Michael Estner
On Wed, Jun 12, 2024 at 02:41:09PM +0200, Phil Sutter wrote:
> The former FIXME comment pointed at the fact that struct ebt_entry does
> not have a 'flags' field (unlike struct ipt_ip). In fact, ebt_entry's
> equivalent is 'bitmask' field. Comparing that instead is the right
> thing to do, even though it does not seem to make a difference in
> practice: No rule options alter just the bitmask value, nor is it
> possible to fill an associated field with default values (e.g. all-zero
> MAC and mask).
>
> Since the situation described above might change and there is a slight
> performance improvement in some cases (e.g. comparing rules differing
> only by specified/omitted source/dest MAC address), add the check
> anyway.
>
> Suggested-by: Michael Estner <michaelestner@web.de>
> Signed-off-by: Phil Sutter <phil@nwl.cc>
Also applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-12 20:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-12 12:41 [iptables PATCH] ebtables: Include 'bitmask' value when comparing rules Phil Sutter
2024-06-12 20:45 ` Phil Sutter
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).