]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ebtables: trivial: Leverage C99-style initializers a bit more
authorPhil Sutter <phil@nwl.cc>
Thu, 23 Aug 2018 15:43:22 +0000 (17:43 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Aug 2018 08:05:51 +0000 (10:05 +0200)
This nit was discovered when comparing do_commandeb() with
do_commandeb_xlate(): Since 'cs' is initialized upon declaration
already, initialization of field '.eb.bitmask' may be moved there as
well.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/xtables-eb.c

index 534714de7999af1d15faa165df09d15c3ad908fd..68f12500e524d79ea0fd620a7f4b5a1c54dee831 100644 (file)
@@ -769,6 +769,7 @@ int do_commandeb(struct nft_handle *h, int argc, char *argv[], char **table,
        struct xtables_match *m;
        struct iptables_command_state cs = {
                .argv = argv,
+               .eb.bitmask = EBT_NOPROTO,
        };
        char command = 'h';
        const char *chain = NULL;
@@ -790,7 +791,6 @@ int do_commandeb(struct nft_handle *h, int argc, char *argv[], char **table,
        /* prevent getopt to spoil our error reporting */
        optind = 0;
        opterr = false;
-       cs.eb.bitmask = EBT_NOPROTO;
 
        /* Getopt saves the day */
        while ((c = getopt_long(argc, argv,