Blame SOURCES/0011-ebtables-extensions-Constify-option-struct.patch

05e71a
From d1824930e9c9011c84f162db71d1ed649e14a6d1 Mon Sep 17 00:00:00 2001
05e71a
From: Gargi Sharma <gs051095@gmail.com>
05e71a
Date: Tue, 28 Mar 2017 19:42:39 +0530
05e71a
Subject: [PATCH] ebtables: extensions: Constify option struct
05e71a
05e71a
The struct  of the type option is only used to initialise a field
05e71a
inside the ebt_u_watcher or ebt_u_target or ebt_u_match struct and
05e71a
is not modified anywhere.
05e71a
05e71a
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
05e71a
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
05e71a
Signed-off-by: Phil Sutter <psutter@redhat.com>
05e71a
---
05e71a
 extensions/ebt_802_3.c    | 2 +-
05e71a
 extensions/ebt_among.c    | 2 +-
05e71a
 extensions/ebt_arp.c      | 2 +-
05e71a
 extensions/ebt_arpreply.c | 2 +-
05e71a
 extensions/ebt_ip.c       | 2 +-
05e71a
 extensions/ebt_limit.c    | 2 +-
05e71a
 extensions/ebt_log.c      | 2 +-
05e71a
 extensions/ebt_mark.c     | 2 +-
05e71a
 extensions/ebt_mark_m.c   | 2 +-
05e71a
 extensions/ebt_nat.c      | 4 ++--
05e71a
 extensions/ebt_nflog.c    | 2 +-
05e71a
 extensions/ebt_pkttype.c  | 2 +-
05e71a
 extensions/ebt_redirect.c | 2 +-
05e71a
 extensions/ebt_standard.c | 2 +-
05e71a
 extensions/ebt_stp.c      | 2 +-
05e71a
 extensions/ebt_ulog.c     | 2 +-
05e71a
 extensions/ebt_vlan.c     | 2 +-
05e71a
 17 files changed, 18 insertions(+), 18 deletions(-)
05e71a
05e71a
diff --git a/extensions/ebt_802_3.c b/extensions/ebt_802_3.c
05e71a
index dd22eb2605334..458484939231d 100644
05e71a
--- a/extensions/ebt_802_3.c
05e71a
+++ b/extensions/ebt_802_3.c
05e71a
@@ -17,7 +17,7 @@
05e71a
 #define _802_3_SAP '1'
05e71a
 #define _802_3_TYPE '2'
05e71a
 
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "802_3-sap"   , required_argument, 0, _802_3_SAP },
05e71a
 	{ "802_3-type"  , required_argument, 0, _802_3_TYPE },
05e71a
diff --git a/extensions/ebt_among.c b/extensions/ebt_among.c
05e71a
index f97d07ec118ed..e4fc5ac22a005 100644
05e71a
--- a/extensions/ebt_among.c
05e71a
+++ b/extensions/ebt_among.c
05e71a
@@ -26,7 +26,7 @@
05e71a
 #define AMONG_DST_F '3'
05e71a
 #define AMONG_SRC_F '4'
05e71a
 
05e71a
-static struct option opts[] = {
05e71a
+static const struct option opts[] = {
05e71a
 	{"among-dst", required_argument, 0, AMONG_DST},
05e71a
 	{"among-src", required_argument, 0, AMONG_SRC},
05e71a
 	{"among-dst-file", required_argument, 0, AMONG_DST_F},
05e71a
diff --git a/extensions/ebt_arp.c b/extensions/ebt_arp.c
05e71a
index 64d337d5967cf..b2819553ab313 100644
05e71a
--- a/extensions/ebt_arp.c
05e71a
+++ b/extensions/ebt_arp.c
05e71a
@@ -24,7 +24,7 @@
05e71a
 #define ARP_MAC_S  '6'
05e71a
 #define ARP_MAC_D  '7'
05e71a
 #define ARP_GRAT   '8'
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "arp-opcode"    , required_argument, 0, ARP_OPCODE },
05e71a
 	{ "arp-op"        , required_argument, 0, ARP_OPCODE },
05e71a
diff --git a/extensions/ebt_arpreply.c b/extensions/ebt_arpreply.c
05e71a
index c3757f389ba23..51eda66adbff3 100644
05e71a
--- a/extensions/ebt_arpreply.c
05e71a
+++ b/extensions/ebt_arpreply.c
05e71a
@@ -19,7 +19,7 @@ static int mac_supplied;
05e71a
 
05e71a
 #define REPLY_MAC '1'
05e71a
 #define REPLY_TARGET '2'
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "arpreply-mac" ,    required_argument, 0, REPLY_MAC    },
05e71a
 	{ "arpreply-target" , required_argument, 0, REPLY_TARGET },
05e71a
diff --git a/extensions/ebt_ip.c b/extensions/ebt_ip.c
05e71a
index 4e0b7f0780302..59559feffa50b 100644
05e71a
--- a/extensions/ebt_ip.c
05e71a
+++ b/extensions/ebt_ip.c
05e71a
@@ -25,7 +25,7 @@
05e71a
 #define IP_SPORT  '5'
05e71a
 #define IP_DPORT  '6'
05e71a
 
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "ip-source"           , required_argument, 0, IP_SOURCE },
05e71a
 	{ "ip-src"              , required_argument, 0, IP_SOURCE },
05e71a
diff --git a/extensions/ebt_limit.c b/extensions/ebt_limit.c
05e71a
index d189a09aa7cab..2cbf4dee51fb4 100644
05e71a
--- a/extensions/ebt_limit.c
05e71a
+++ b/extensions/ebt_limit.c
05e71a
@@ -41,7 +41,7 @@ static int string_to_number(const char *s, unsigned int min, unsigned int max,
05e71a
 #define ARG_LIMIT		'1'
05e71a
 #define ARG_LIMIT_BURST		'2'
05e71a
 
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "limit",		required_argument, 0, ARG_LIMIT },
05e71a
 	{ "limit-burst",	required_argument, 0, ARG_LIMIT_BURST },
05e71a
diff --git a/extensions/ebt_log.c b/extensions/ebt_log.c
05e71a
index 1cf831a7ec17a..97d50919d25ca 100644
05e71a
--- a/extensions/ebt_log.c
05e71a
+++ b/extensions/ebt_log.c
05e71a
@@ -61,7 +61,7 @@ static int name_to_loglevel(char* arg)
05e71a
 #define LOG_IP     '4'
05e71a
 #define LOG_LOG    '5'
05e71a
 #define LOG_IP6    '6'
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "log-prefix", required_argument, 0, LOG_PREFIX },
05e71a
 	{ "log-level" , required_argument, 0, LOG_LEVEL  },
05e71a
diff --git a/extensions/ebt_mark.c b/extensions/ebt_mark.c
05e71a
index 5776b1cb24509..4cf1378d5085c 100644
05e71a
--- a/extensions/ebt_mark.c
05e71a
+++ b/extensions/ebt_mark.c
05e71a
@@ -20,7 +20,7 @@ static int mark_supplied;
05e71a
 #define MARK_ORMARK  '3'
05e71a
 #define MARK_ANDMARK '4'
05e71a
 #define MARK_XORMARK '5'
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "mark-target" , required_argument, 0, MARK_TARGET },
05e71a
 	/* an oldtime messup, we should have always used the scheme
05e71a
diff --git a/extensions/ebt_mark_m.c b/extensions/ebt_mark_m.c
05e71a
index 2a259b04368d0..7561f059c0108 100644
05e71a
--- a/extensions/ebt_mark_m.c
05e71a
+++ b/extensions/ebt_mark_m.c
05e71a
@@ -15,7 +15,7 @@
05e71a
 
05e71a
 #define MARK '1'
05e71a
 
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "mark", required_argument, 0, MARK },
05e71a
 	{ 0 }
05e71a
diff --git a/extensions/ebt_nat.c b/extensions/ebt_nat.c
05e71a
index e6afbf8f3a3f8..00d9cd4083247 100644
05e71a
--- a/extensions/ebt_nat.c
05e71a
+++ b/extensions/ebt_nat.c
05e71a
@@ -21,7 +21,7 @@ static int to_source_supplied, to_dest_supplied;
05e71a
 #define NAT_S_TARGET '2'
05e71a
 #define NAT_D_TARGET '2'
05e71a
 #define NAT_S_ARP '3'
05e71a
-static struct option opts_s[] =
05e71a
+static const struct option opts_s[] =
05e71a
 {
05e71a
 	{ "to-source"     , required_argument, 0, NAT_S },
05e71a
 	{ "to-src"        , required_argument, 0, NAT_S },
05e71a
@@ -30,7 +30,7 @@ static struct option opts_s[] =
05e71a
 	{ 0 }
05e71a
 };
05e71a
 
05e71a
-static struct option opts_d[] =
05e71a
+static const struct option opts_d[] =
05e71a
 {
05e71a
 	{ "to-destination", required_argument, 0, NAT_D },
05e71a
 	{ "to-dst"        , required_argument, 0, NAT_D },
05e71a
diff --git a/extensions/ebt_nflog.c b/extensions/ebt_nflog.c
05e71a
index 0cd10e05f1c33..405673a01f893 100644
05e71a
--- a/extensions/ebt_nflog.c
05e71a
+++ b/extensions/ebt_nflog.c
05e71a
@@ -25,7 +25,7 @@ enum {
05e71a
 	NFLOG_NFLOG = 0x16,
05e71a
 };
05e71a
 
05e71a
-static struct option nflog_opts[] = {
05e71a
+static const struct option nflog_opts[] = {
05e71a
 	{"nflog-group", required_argument, NULL, NFLOG_GROUP},
05e71a
 	{"nflog-prefix", required_argument, NULL, NFLOG_PREFIX},
05e71a
 	{"nflog-range", required_argument, NULL, NFLOG_RANGE},
05e71a
diff --git a/extensions/ebt_pkttype.c b/extensions/ebt_pkttype.c
05e71a
index 5b5cb0398d559..486c85c3c3faf 100644
05e71a
--- a/extensions/ebt_pkttype.c
05e71a
+++ b/extensions/ebt_pkttype.c
05e71a
@@ -27,7 +27,7 @@ char *classes[] =
05e71a
 	"\0"
05e71a
 };
05e71a
 
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "pkttype-type"        , required_argument, 0, '1' },
05e71a
 	{ 0 }
05e71a
diff --git a/extensions/ebt_redirect.c b/extensions/ebt_redirect.c
05e71a
index e47081894317c..3f8227a917583 100644
05e71a
--- a/extensions/ebt_redirect.c
05e71a
+++ b/extensions/ebt_redirect.c
05e71a
@@ -14,7 +14,7 @@
05e71a
 #include <linux/netfilter_bridge/ebt_redirect.h>
05e71a
 
05e71a
 #define REDIRECT_TARGET '1'
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "redirect-target", required_argument, 0, REDIRECT_TARGET },
05e71a
 	{ 0 }
05e71a
diff --git a/extensions/ebt_standard.c b/extensions/ebt_standard.c
05e71a
index 67d4d7cc7046b..81edead71a840 100644
05e71a
--- a/extensions/ebt_standard.c
05e71a
+++ b/extensions/ebt_standard.c
05e71a
@@ -11,7 +11,7 @@
05e71a
 #include <getopt.h>
05e71a
 #include "../include/ebtables_u.h"
05e71a
 
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{0}
05e71a
 };
05e71a
diff --git a/extensions/ebt_stp.c b/extensions/ebt_stp.c
05e71a
index 2b108a707fe65..5c5fc3334311d 100644
05e71a
--- a/extensions/ebt_stp.c
05e71a
+++ b/extensions/ebt_stp.c
05e71a
@@ -27,7 +27,7 @@
05e71a
 #define STP_FWDD	'l'
05e71a
 #define STP_NUMOPS 12
05e71a
 
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "stp-type"         , required_argument, 0, STP_TYPE},
05e71a
 	{ "stp-flags"        , required_argument, 0, STP_FLAGS},
05e71a
diff --git a/extensions/ebt_ulog.c b/extensions/ebt_ulog.c
05e71a
index 162586d7a4c35..54eec53f7069f 100644
05e71a
--- a/extensions/ebt_ulog.c
05e71a
+++ b/extensions/ebt_ulog.c
05e71a
@@ -24,7 +24,7 @@
05e71a
 #define ULOG_CPRANGE    '3'
05e71a
 #define ULOG_QTHRESHOLD '4'
05e71a
 #define ULOG_ULOG       '5'
05e71a
-static struct option opts[] =
05e71a
+static const struct option opts[] =
05e71a
 {
05e71a
 	{ "ulog-prefix"    , required_argument, 0, ULOG_PREFIX     },
05e71a
 	{ "ulog-nlgroup"   , required_argument, 0, ULOG_NLGROUP    },
05e71a
diff --git a/extensions/ebt_vlan.c b/extensions/ebt_vlan.c
05e71a
index 6714c82d4d1ac..0a37067b5ebde 100644
05e71a
--- a/extensions/ebt_vlan.c
05e71a
+++ b/extensions/ebt_vlan.c
05e71a
@@ -25,7 +25,7 @@
05e71a
 #define VLAN_PRIO  '2'
05e71a
 #define VLAN_ENCAP '3'
05e71a
 
05e71a
-static struct option opts[] = {
05e71a
+static const struct option opts[] = {
05e71a
 	{"vlan-id"   , required_argument, NULL, VLAN_ID},
05e71a
 	{"vlan-prio" , required_argument, NULL, VLAN_PRIO},
05e71a
 	{"vlan-encap", required_argument, NULL, VLAN_ENCAP},
05e71a
-- 
05e71a
2.21.0
05e71a