]> git.ipfire.org Git - thirdparty/iptables.git/commit
iptables: Constify option struct
authorGargi Sharma <gs051095@gmail.com>
Mon, 27 Mar 2017 19:10:15 +0000 (00:40 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 27 Mar 2017 19:13:08 +0000 (21:13 +0200)
commit1cf4ba6fbe85b3cbe9828a7947000290e1989986
tree8f8bb7f8f70750211e66f85658014943c2c23efc
parent999eaa241212d3952ddff39a99d0d55a74e3639e
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>
extensions/libebt_limit.c
extensions/libebt_mark.c
extensions/libebt_mark_m.c
extensions/libebt_nflog.c