Skip to contentSkip to conversation

libxt_tcp: print space before, not after "flags:"

PATCH Applied Andreas Schwab 2 participants 2 messages Aug 20, 2012 – Aug 21, 2012 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxt_tcp: print space before, not after "flags:"

---
 extensions/libxt_tcp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
extensions/libxt_tcp.c +2 -3
index e849fa2..bbdec45 100644
@@ -278,11 +278,10 @@ static void
 print_flags(uint8_t mask, uint8_t cmp, int invert, int numeric)
 {
 	if (mask || invert) {
-		printf("flags:%s", invert ? "!" : "");
+		printf(" flags:%s", invert ? "!" : "");
 		if (numeric)
-			printf(" 0x%02X/0x%02X", mask, cmp);
+			printf("0x%02X/0x%02X", mask, cmp);
 		else {
-			printf(" ");
 			print_tcpf(mask);
 			printf("/");
 			print_tcpf(cmp);
Signature · 7 lines
1.7.12


-- 
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
maintainer Applied
#1 lore raw
Quoted 13 lines · Andreas Schwab
---
 extensions/libxt_tcp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
extensions/libxt_tcp.c +0 -0
index e849fa2..bbdec45 100644
@@ -278,11 +278,10 @@ static void
 print_flags(uint8_t mask, uint8_t cmp, int invert, int numeric)
 {
 	if (mask || invert) {

extensions/libxt_tcp.c static void · line 287

Quoted 10 lines
extensions/libxt_tcp.c +2 -3
-		printf("flags:%s", invert ? "!" : "");
+		printf(" flags:%s", invert ? "!" : "");
 		if (numeric)
-			printf(" 0x%02X/0x%02X", mask, cmp);
+			printf("0x%02X/0x%02X", mask, cmp);
 		else {
-			printf(" ");
 			print_tcpf(mask);
 			printf("/");
 			print_tcpf(cmp);

Right, iptables -L -n is broken indeed:

tcp dpt:10flags: 0x17/0x02

Applied, thanks.