]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: constify option struct
authorArushi Singhal <arushisinghal19971997@gmail.com>
Wed, 21 Mar 2018 09:50:28 +0000 (15:20 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 11 Apr 2018 08:40:03 +0000 (10:40 +0200)
The struct of type option is only used to initialise a field and
is not modified anywhere.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libarpt_mangle.c
iptables/iptables-xml.c

index ec9b5436d473c04263ca4ab4c1af4740065d8a88..0d1f140ac28b5dc3895455edb325009ab5048b4c 100644 (file)
@@ -32,7 +32,7 @@ static void arpmangle_print_help(void)
 #define MANGLE_DEVT   '4'
 #define MANGLE_TARGET '5'
 
-static struct option arpmangle_opts[] = {
+static const struct option arpmangle_opts[] = {
        { .name = "mangle-ip-s",        .has_arg = true, .val = MANGLE_IPS },
        { .name = "mangle-ip-d",        .has_arg = true, .val = MANGLE_IPT },
        { .name = "mangle-mac-s",       .has_arg = true, .val = MANGLE_DEVS },
index 49674ec1e247975602cc5666bf2b9b9ef6cafdf2..69c19a60180f2226d8abcef74942e0b9472f2d3a 100644 (file)
@@ -38,7 +38,7 @@ static int verbose;
 /* Whether to combine actions of sequential rules with identical conditions */
 static int combine;
 /* Keeping track of external matches and targets.  */
-static struct option options[] = {
+static const struct option options[] = {
        {"verbose", 0, NULL, 'v'},
        {"combine", 0, NULL, 'c'},
        {"help", 0, NULL, 'h'},