Skip to contentSkip to conversation

libxt_sctp: fix discards 'const' qualifier

PATCH New Rudi Heitbaum 1 participant 1 message Feb 20 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 libxt_sctp: fix discards 'const' qualifier

p is used as the return from strchr(sctp_chunk_names[i].valid_flags) which is a const char. Declare p as a const char * pointer for use addressing the warning.

Fixes:
extensions/libxt_sctp.c: In function 'parse_sctp_chunk':
extensions/libxt_sctp.c:211:40: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
211 | if ((p = strchr(sctp_chunk_names[i].valid_flags,
| ^

---
 extensions/libxt_sctp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
extensions/libxt_sctp.c +1 -1
index 6b002402..895a3e8a 100644
@@ -205,7 +205,7 @@ parse_sctp_chunk(struct xt_sctp_info *einfo,
 		if (chunk_flags) {
 			DEBUGP("Chunk flags %s\n", chunk_flags);
 			for (j = 0; j < strlen(chunk_flags); j++) {
-				char *p;
+				const char *p;
 				int bit;
 
 				if ((p = strchr(sctp_chunk_names[i].valid_flags, 
Signature · 1 line
2.51.0