From: Arushi Singhal <arushisinghal19971997@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: Arushi Singhal <arushisinghal19971997@gmail.com>
Subject: [PATCH 2/2] iptables: iptables: Constify option struct
Date: Sun, 2 Apr 2017 12:35:08 +0530 [thread overview]
Message-ID: <20170402070508.20770-2-arushisinghal19971997@gmail.com> (raw)
In-Reply-To: <20170402070508.20770-1-arushisinghal19971997@gmail.com>
The structs of the type option are not modified anywhere.
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
iptables/ip6tables.c | 2 +-
iptables/iptables-xml.c | 2 +-
iptables/xtables-arp.c | 2 +-
iptables/xtables-eb.c | 2 +-
iptables/xtables.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index 579d347..fd1c541 100644
--- a/iptables/ip6tables.c
+++ b/iptables/ip6tables.c
@@ -78,7 +78,7 @@ static const char optflags[]
static const char unsupported_rev[] = " [unsupported revision]";
-static struct option original_opts[] = {
+static const struct option original_opts[] = {
{.name = "append", .has_arg = 1, .val = 'A'},
{.name = "delete", .has_arg = 1, .val = 'D'},
{.name = "check" , .has_arg = 1, .val = 'C'},
diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c
index 740a563..abe7bbe 100644
--- a/iptables/iptables-xml.c
+++ b/iptables/iptables-xml.c
@@ -38,7 +38,7 @@ static int verbose = 0;
/* Whether to combine actions of sequential rules with identical conditions */
static int combine = 0;
/* 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'},
diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c
index 6aa000a..85feb48 100644
--- a/iptables/xtables-arp.c
+++ b/iptables/xtables-arp.c
@@ -107,7 +107,7 @@ static const char cmdflags[] = { 'I', 'D', 'D', 'R', 'A', 'L', 'F', 'Z',
static const char optflags[NUMBER_OF_OPT]
= { 'n', 's', 'd', 2, 3, 7, 8, 4, 5, 6, 'j', 'v', 'i', 'o', '0', 'c'};
-static struct option original_opts[] = {
+static const struct option original_opts[] = {
{ "append", 1, 0, 'A' },
{ "delete", 1, 0, 'D' },
{ "insert", 1, 0, 'I' },
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
index c8b5d4f..60ec935 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -247,7 +247,7 @@ static int get_current_chain(const char *chain)
/* Default command line options. Do not mess around with the already
* assigned numbers unless you know what you are doing */
-static struct option ebt_original_options[] =
+static const struct option ebt_original_options[] =
{
{ "append" , required_argument, 0, 'A' },
{ "insert" , required_argument, 0, 'I' },
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 286866f..636aa87 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -59,7 +59,7 @@ static const char cmdflags[] = { 'I', 'D', 'D', 'R', 'A', 'L', 'F', 'Z',
static const char optflags[]
= { 'n', 's', 'd', 'p', 'j', 'v', 'x', 'i', 'o', '0', 'c', 'f'};
-static struct option original_opts[] = {
+static const struct option original_opts[] = {
{.name = "append", .has_arg = 1, .val = 'A'},
{.name = "delete", .has_arg = 1, .val = 'D'},
{.name = "check", .has_arg = 1, .val = 'C'},
--
2.11.0
next prev parent reply other threads:[~2017-04-02 7:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-02 7:05 [PATCH 1/2] extensions: libarpt_mangle.c : Constify option struct Arushi Singhal
2017-04-02 7:05 ` Arushi Singhal [this message]
2017-04-07 18:33 ` [PATCH 2/2] iptables: iptables: " Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170402070508.20770-2-arushisinghal19971997@gmail.com \
--to=arushisinghal19971997@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).