All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rudi Heitbaum <rudi@heitbaum.com>
To: netfilter-devel@vger.kernel.org
Cc: rudi@heitbaum.com
Subject: [PATCH 1/3 iptables] xshared: fix discards 'const' qualifier
Date: Fri, 20 Feb 2026 09:37:46 +0000	[thread overview]
Message-ID: <aZgragyOBo2vEOUe@6f548583a531> (raw)

argv is passed by parse_change_counters_rule and do_parse to parse_rule_range
as a const char. parse_rule_range modifies thepassed in argv, so pass as
non const so that it can be modified without warning.

Fixes:
    iptables/xshared.c: In function 'parse_rule_range':
    iptables/xshared.c:912:23: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      912 |         char *colon = strchr(argv, ':'), *buffer;
          |                       ^~~~~~

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
 iptables/xshared.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iptables/xshared.c b/iptables/xshared.c
index b941b8df..26e91e37 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -907,7 +907,7 @@ static int parse_rulenumber(const char *rule)
 	return rulenum;
 }
 
-static void parse_rule_range(struct xt_cmd_parse *p, const char *argv)
+static void parse_rule_range(struct xt_cmd_parse *p, char *argv)
 {
 	char *colon = strchr(argv, ':'), *buffer;
 
-- 
2.51.0


                 reply	other threads:[~2026-02-20  9:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aZgragyOBo2vEOUe@6f548583a531 \
    --to=rudi@heitbaum.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 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.