summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-eb-translate.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-07-19 18:31:54 +0200
committerFlorian Westphal <fw@strlen.de>2018-07-19 22:15:12 +0200
commit87b5b9e2240e7cd5487d160cc3e059c61622ce75 (patch)
tree490686a1485eed2d1a9b3a055a797f1983f97794 /iptables/xtables-eb-translate.c
parent907da5c505b219537586f7c2bdb7320c4f97386f (diff)
iptables: replace memset by c99-style initializers
This cleans up a few obvious cases identified by grepping the source code for 'memset'. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xtables-eb-translate.c')
-rw-r--r--iptables/xtables-eb-translate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/iptables/xtables-eb-translate.c b/iptables/xtables-eb-translate.c
index 42b88e35..1e66bf71 100644
--- a/iptables/xtables-eb-translate.c
+++ b/iptables/xtables-eb-translate.c
@@ -288,7 +288,10 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char
unsigned int flags = 0;
struct xtables_target *t, *w;
struct xtables_match *m;
- struct iptables_command_state cs;
+ struct iptables_command_state cs = {
+ .argv = argv,
+ .eb.bitmask = EBT_NOPROTO,
+ };
char command = 'h';
const char *chain = NULL;
int exec_style = EXEC_STYLE_PRG;
@@ -299,9 +302,6 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char
.table = *table,
};
- memset(&cs, 0, sizeof(cs));
- cs.argv = argv;
-
if (nft_init(h, xtables_bridge) < 0)
xtables_error(OTHER_PROBLEM,
"Could not initialize nftables layer.");
@@ -328,7 +328,6 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char
/* prevent getopt to spoil our error reporting */
opterr = false;
- cs.eb.bitmask = EBT_NOPROTO;
printf("nft ");
/* Getopt saves the day */