]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
arptables-nft: Set h-type/h-length masks by default, too
authorPhil Sutter <phil@nwl.cc>
Fri, 1 Feb 2019 16:06:18 +0000 (17:06 +0100)
committerFlorian Westphal <fw@strlen.de>
Fri, 1 Feb 2019 16:09:37 +0000 (17:09 +0100)
These masks are not used in nftables backend, but mangle extension
checks arhln_mask value to make sure --h-length was given (which is
implicitly the case).

Fixes: 5aecb2d8bfdda ("arptables: pre-init hlen and ethertype")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/xtables-arp.c

index 57e717fa901a1187bd9ec6b154e2999b96e7b408..4b663775c5bee110d4d906044ec639b5f8b41d39 100644 (file)
@@ -910,8 +910,12 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table,
 {
        struct iptables_command_state cs = {
                .jumpto = "",
-               .arp.arp.arhln = 6,
-               .arp.arp.arhrd = htons(ARPHRD_ETHER),
+               .arp.arp = {
+                       .arhln = 6,
+                       .arhln_mask = 255,
+                       .arhrd = htons(ARPHRD_ETHER),
+                       .arhrd_mask = 65535,
+               },
        };
        int invert = 0;
        unsigned int nsaddrs = 0, ndaddrs = 0;