All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iptables: extension: Constify option struct
@ 2018-03-21  9:44 Arushi Singhal
  2018-03-21  9:48 ` Arushi Singhal
  0 siblings, 1 reply; 2+ messages in thread
From: Arushi Singhal @ 2018-03-21  9:44 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo, kadlec, fw, davem, outreachy-kernel

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>
---
 extensions/libarpt_mangle.c | 2 +-
 iptables/iptables-xml.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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'},
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iptables: extension: Constify option struct
  2018-03-21  9:44 [PATCH] iptables: extension: Constify option struct Arushi Singhal
@ 2018-03-21  9:48 ` Arushi Singhal
  0 siblings, 0 replies; 2+ messages in thread
From: Arushi Singhal @ 2018-03-21  9:48 UTC (permalink / raw)
  To: Netfilter Developer Mailing List
  Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	David S. Miller, outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]

On Wed, Mar 21, 2018 at 3:14 PM, Arushi Singhal <
arushisinghal19971997@gmail.com> wrote:

> 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>
> ---
>  extensions/libarpt_mangle.c | 2 +-
>  iptables/iptables-xml.c     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> 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'},
> --
> 2.7.4
>
>
Please ignore this patch.

[-- Attachment #2: Type: text/html, Size: 2351 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-21  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21  9:44 [PATCH] iptables: extension: Constify option struct Arushi Singhal
2018-03-21  9:48 ` Arushi Singhal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.