diff options
author | Gargi Sharma <gs051095@gmail.com> | 2017-03-28 00:40:15 +0530 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-03-27 21:13:08 +0200 |
commit | 1cf4ba6fbe85b3cbe9828a7947000290e1989986 (patch) | |
tree | 8f8bb7f8f70750211e66f85658014943c2c23efc /extensions/libebt_mark.c | |
parent | 999eaa241212d3952ddff39a99d0d55a74e3639e (diff) | |
download | iptables-1cf4ba6fbe85b3cbe9828a7947000290e1989986.tar.gz |
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 <gs051095@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'extensions/libebt_mark.c')
-rw-r--r-- | extensions/libebt_mark.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/libebt_mark.c b/extensions/libebt_mark.c index a1a208c3..7b80b22e 100644 --- a/extensions/libebt_mark.c +++ b/extensions/libebt_mark.c @@ -25,7 +25,7 @@ static int mark_supplied; #define MARK_ORMARK '3' #define MARK_ANDMARK '4' #define MARK_XORMARK '5' -static struct option brmark_opts[] = { +static const struct option brmark_opts[] = { { .name = "mark-target",.has_arg = true, .val = MARK_TARGET }, /* an oldtime messup, we should have always used the scheme * <extension-name>-<option> */ |