From 1cf4ba6fbe85b3cbe9828a7947000290e1989986 Mon Sep 17 00:00:00 2001 From: Gargi Sharma Date: Tue, 28 Mar 2017 00:40:15 +0530 Subject: iptables: Constify option struct The struct of the type option is only used to initialise a field inside the xtables_match struct and is not modified anywhere. Done using Coccinelle: @r1 disable optional_qualifier@ identifier s,i; position p; @@ static struct option i@p[] ={...}; @ok1@ identifier r1.i; expression e; position p; @@ e = i@p @bad@ position p != {r1.p,ok1.p}; identifier r1.i; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct option i[] = { ... }; Signed-off-by: Gargi Sharma Signed-off-by: Pablo Neira Ayuso --- extensions/libebt_nflog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extensions/libebt_nflog.c') diff --git a/extensions/libebt_nflog.c b/extensions/libebt_nflog.c index fef71960..5f1d13b1 100644 --- a/extensions/libebt_nflog.c +++ b/extensions/libebt_nflog.c @@ -30,7 +30,7 @@ enum { NFLOG_NFLOG = 0x16, }; -static struct option brnflog_opts[] = { +static const struct option brnflog_opts[] = { { .name = "nflog-group", .has_arg = true, .val = NFLOG_GROUP}, { .name = "nflog-prefix", .has_arg = true, .val = NFLOG_PREFIX}, { .name = "nflog-range", .has_arg = true, .val = NFLOG_RANGE}, -- cgit v1.2.3