Skip to contentSkip to conversation

netfilter: nf_conntrack_sip: Fix inconsistent of format with argument type in nf_nat_sip.

PATCH In review Ye Bin 2 participants 2 messages Oct 9, 2020 – Oct 20, 2020

Subsystems (2)
lore
Share & tools
lore

Ye Bin

author
#0 lore raw

PATCH 1/1 netfilter: nf_conntrack_sip: Fix inconsistent of format with argument type in nf_nat_sip.

Fix follow warning:
[net/netfilter/nf_nat_sip.c:469]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

---
 net/netfilter/nf_nat_sip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_nat_sip.c +1 -1
index f0a735e86851..39754fb3a298 100644
@@ -466,7 +466,7 @@ static int mangle_content_len(struct sk_buff *skb, unsigned int protoff,
 			      &matchoff, &matchlen) <= 0)
 		return 0;
 
-	buflen = sprintf(buffer, "%u", c_len);
+	buflen = sprintf(buffer, "%d", c_len);
 	return mangle_packet(skb, protoff, dataoff, dptr, datalen,
 			     matchoff, matchlen, buffer, buflen);
 }
Signature · 1 line
2.16.2.dirty
#1 lore raw
Quoted 3 lines · Ye Bin

Fix follow warning:
[net/netfilter/nf_nat_sip.c:469]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Yes, but mangle_packet() takes unsigned int as buflen.

This needs a bit wider look that, I'm afraid, a robot cannot afford.

Thanks for submitting your patch in any case.

Quoted 22 lines
---
 net/netfilter/nf_nat_sip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_nat_sip.c +1 -1
index f0a735e86851..39754fb3a298 100644
@@ -466,7 +466,7 @@ static int mangle_content_len(struct sk_buff *skb, unsigned int protoff,
 			      &matchoff, &matchlen) <= 0)
 		return 0;
 
-	buflen = sprintf(buffer, "%u", c_len);
+	buflen = sprintf(buffer, "%d", c_len);
 	return mangle_packet(skb, protoff, dataoff, dptr, datalen,
 			     matchoff, matchlen, buffer, buflen);
 }
Signature · 1 line
2.16.2.dirty