Skip to contentSkip to conversation

iptables: xtables-eb: Remove const qualifier from struct option

PATCH Applied Varsha Rao 2 participants 4 messages Nov 30, 2017 netfilter

lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH 1/1 iptables: xtables-eb: Remove const qualifier from struct option

As opts is reassigned multiple times, it cannot be made constant. So remove const qualifier from structure option. This patch fixes the following warning.

xtables-eb.c: In function ‘ebt_load_match_extensions’:
xtables-eb.c:653:7: warning: assignment discards ‘const’ qualifier from pointer target type
opts = ebt_original_options;

---
 iptables/xtables-eb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/xtables-eb.c +1 -1
index 60ec935c..c8b5d4f3 100644
@@ -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 const struct option ebt_original_options[] =
+static struct option ebt_original_options[] =
 {
 	{ "append"         , required_argument, 0, 'A' },
 	{ "insert"         , required_argument, 0, 'I' },
Signature · 1 line
2.14.3
author
#1 lore raw

PATCH 1/1 extensions: libxt_tcpmss: Add test case for invalid ranges.

This patch adds test case for invalid MSS range.

---
 extensions/libxt_tcpmss.t | 1 +
 1 file changed, 1 insertion(+)
extensions/libxt_tcpmss.t +1 -0
index 3181e49d..2b415957 100644
@@ -3,3 +3,4 @@
 -p tcp -m tcpmss --mss 42;=;OK
 -p tcp -m tcpmss --mss 42:12345;=;OK
 -p tcp -m tcpmss --mss 42:65536;;FAIL
+-p tcp -m tcpmss --mss 65535:1000;;FAIL
Signature · 1 line
2.14.3
#2 lore raw

Re: [PATCH iptables] extensions: libxt_tcpmss: Add test case for invalid ranges.

Quoted 1 line · Varsha Rao

This patch adds test case for invalid MSS range.

Also applied, thanks.

maintainer Applied
#3 lore raw
In reply to Varsha Rao
Quoted 8 lines · Varsha Rao

As opts is reassigned multiple times, it cannot be made constant. So remove const qualifier from structure option. This patch fixes the following warning.

xtables-eb.c: In function ‘ebt_load_match_extensions’:
xtables-eb.c:653:7: warning: assignment discards ‘const’ qualifier from pointer target type
opts = ebt_original_options;

Applied, thanks Varsha.