summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVarsha Rao <rvarsha016@gmail.com>2017-03-30 00:57:02 +0530
committerPablo Neira Ayuso <pablo@netfilter.org>2017-04-06 18:21:13 +0200
commit2963a8df2175be68af6cafce83a8561aa4cf6244 (patch)
tree3ee81668e8a845a41a1ddc2a22dda5109a95e123
parent1cf4ba6fbe85b3cbe9828a7947000290e1989986 (diff)
iptables: Remove explicit static variables initalization.
Static variables are initialized to zero by default, so remove explicit initalization. This patch fixes the checkpatch issue. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--iptables/ip6tables-restore.c2
-rw-r--r--iptables/ip6tables-save.c2
-rw-r--r--iptables/iptables-restore.c2
-rw-r--r--iptables/iptables-save.c2
-rw-r--r--iptables/iptables-xml.c10
-rw-r--r--iptables/xtables-arp.c2
-rw-r--r--iptables/xtables-restore.c2
7 files changed, 11 insertions, 11 deletions
diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c
index 8a47f09c..30a4ade7 100644
--- a/iptables/ip6tables-restore.c
+++ b/iptables/ip6tables-restore.c
@@ -26,7 +26,7 @@
#define DEBUGP(x, args...)
#endif
-static int counters = 0, verbose = 0, noflush = 0, wait = 0;
+static int counters, verbose, noflush, wait;
static struct timeval wait_interval = {
.tv_sec = 1,
diff --git a/iptables/ip6tables-save.c b/iptables/ip6tables-save.c
index 053413a9..c2495d20 100644
--- a/iptables/ip6tables-save.c
+++ b/iptables/ip6tables-save.c
@@ -18,7 +18,7 @@
#include "ip6tables.h"
#include "ip6tables-multi.h"
-static int show_counters = 0;
+static int show_counters;
static const struct option options[] = {
{.name = "counters", .has_arg = false, .val = 'c'},
diff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c
index 7bb06d84..15db3581 100644
--- a/iptables/iptables-restore.c
+++ b/iptables/iptables-restore.c
@@ -23,7 +23,7 @@
#define DEBUGP(x, args...)
#endif
-static int counters = 0, verbose = 0, noflush = 0, wait = 0;
+static int counters, verbose, noflush, wait;
static struct timeval wait_interval = {
.tv_sec = 1,
diff --git a/iptables/iptables-save.c b/iptables/iptables-save.c
index e8ae9c6c..fbc60593 100644
--- a/iptables/iptables-save.c
+++ b/iptables/iptables-save.c
@@ -17,7 +17,7 @@
#include "iptables.h"
#include "iptables-multi.h"
-static int show_counters = 0;
+static int show_counters;
static const struct option options[] = {
{.name = "counters", .has_arg = false, .val = 'c'},
diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c
index 740a563c..2e093b54 100644
--- a/iptables/iptables-xml.c
+++ b/iptables/iptables-xml.c
@@ -34,9 +34,9 @@ struct xtables_globals iptables_xml_globals = {
static void print_usage(const char *name, const char *version)
__attribute__ ((noreturn));
-static int verbose = 0;
+static int verbose;
/* Whether to combine actions of sequential rules with identical conditions */
-static int combine = 0;
+static int combine;
/* Keeping track of external matches and targets. */
static struct option options[] = {
{"verbose", 0, NULL, 'v'},
@@ -73,10 +73,10 @@ parse_counters(char *string, struct xt_counters *ctr)
/* global new argv and argc */
static char *newargv[255];
-static unsigned int newargc = 0;
+static unsigned int newargc;
static char *oldargv[255];
-static unsigned int oldargc = 0;
+static unsigned int oldargc;
/* arg meta data, were they quoted, frinstance */
static int newargvattr[255];
@@ -96,7 +96,7 @@ struct chain {
#define maxChains 10240 /* max chains per table */
static struct chain chains[maxChains];
-static int nextChain = 0;
+static int nextChain;
/* funCtion adding one argument to newargv, updating newargc
* returns true if argument added, false otherwise */
diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c
index 6aa000a1..4a968f4b 100644
--- a/iptables/xtables-arp.c
+++ b/iptables/xtables-arp.c
@@ -150,7 +150,7 @@ static struct option original_opts[] = {
int RUNTIME_NF_ARP_NUMHOOKS = 3;
static struct option *opts = original_opts;
-static unsigned int global_option_offset = 0;
+static unsigned int global_option_offset;
extern void xtables_exit_error(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
struct xtables_globals arptables_globals = {
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index a551c8c1..6afa0d0e 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -24,7 +24,7 @@
#define DEBUGP(x, args...)
#endif
-static int counters = 0, verbose = 0, noflush = 0;
+static int counters, verbose, noflush;
/* Keeping track of external matches and targets. */
static const struct option options[] = {