]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft-bridge: nft_bridge_add() uses wrong flags
authorPhil Sutter <phil@nwl.cc>
Wed, 15 Nov 2023 16:41:50 +0000 (17:41 +0100)
committerPhil Sutter <phil@nwl.cc>
Thu, 23 Nov 2023 16:59:42 +0000 (17:59 +0100)
When checking whether -s or -d was given, invflags were used by
accident. This change has no functional effect since the values remain
the same, but this way it's clear where the previously assigned flags
are used.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft-bridge.c

index d9a8ad2b0f373a6c8bee85afb81af403b54642af..772525e1b45a9c3683c11853e975f4869966167d 100644 (file)
@@ -134,14 +134,14 @@ static int nft_bridge_add(struct nft_handle *h, struct nft_rule_ctx *ctx,
        struct ebt_entry *fw = &cs->eb;
        uint32_t op;
 
-       if (fw->bitmask & EBT_ISOURCE) {
+       if (fw->bitmask & EBT_SOURCEMAC) {
                op = nft_invflags2cmp(fw->invflags, EBT_ISOURCE);
                add_addr(h, r, NFT_PAYLOAD_LL_HEADER,
                         offsetof(struct ethhdr, h_source),
                         fw->sourcemac, fw->sourcemsk, ETH_ALEN, op);
        }
 
-       if (fw->bitmask & EBT_IDEST) {
+       if (fw->bitmask & EBT_DESTMAC) {
                op = nft_invflags2cmp(fw->invflags, EBT_IDEST);
                add_addr(h, r, NFT_PAYLOAD_LL_HEADER,
                         offsetof(struct ethhdr, h_dest),