Message ID | 20180321095028.GA18484@seema-Inspiron-15-3567 |
---|---|
State | Accepted |
Delegated to: | Pablo Neira |
Headers | show |
Series | [v2] iptables: constify option struct | expand |
On Wed, Mar 21, 2018 at 03:20:28PM +0530, Arushi Singhal wrote: > The struct of type option is only used to initialise a field and > is not modified anywhere. I have placed these bits into iptables.git, thanks Arushi. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/extensions/libarpt_mangle.c b/extensions/libarpt_mangle.c index ec9b543..0d1f140 100644 --- a/extensions/libarpt_mangle.c +++ b/extensions/libarpt_mangle.c @@ -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 }, diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c index 49674ec..69c19a6 100644 --- a/iptables/iptables-xml.c +++ b/iptables/iptables-xml.c @@ -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'},
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> --- changes in v2 *subject is modified. extensions/libarpt_mangle.c | 2 +- iptables/iptables-xml.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)