Skip to contentSkip to conversation

libipt_conntrack.c iptables-save bug [PATCH]

PATCH Michael Schwendt 2 participants 2 messages Nov 26, 2002 – Dec 5, 2002 netfilter

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

libipt_conntrack.c in several places also lacks a white-space character after the '!' prefix of an invertable argument.

Since I don't know what the policy is with regard to the print() and save() functions, a temporary fix would be to simply add the missing spaces to the main print sub-function, although they would be printed for iptables -L then, too, and not just for iptables-save. A different solution would need bigger changes to libipt_conntrack.c.

Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE94tzI0iMVcrivHFQRAjtaAJ0SxRseqfsne29+PTTepmyfmTcijgCggLi+ tdc6Fx2KCOSbWKFC7/ILwVI=
=TTzB
-----END PGP SIGNATURE-----

extensions/libipt_conntrack.c +3 -3
diff -Naur iptables-1.2.7a-orig/extensions/libipt_conntrack.c iptables-1.2.7a/extensions/libipt_conntrack.c
@@ -409,7 +409,7 @@
 	if(sinfo->flags & IPT_CONNTRACK_STATE) {
 		printf("%sctstate ", optpfx);
         	if (sinfo->invflags & IPT_CONNTRACK_STATE)
-                	fputc('!', stdout);
+                	printf("! ");
 		print_state(sinfo->statemask);
 	}
 
@@ -456,14 +456,14 @@
 	if(sinfo->flags & IPT_CONNTRACK_STATUS) {
 		printf("%sctstatus ", optpfx);
         	if (sinfo->invflags & IPT_CONNTRACK_STATE)
-                	fputc('!', stdout);
+                	printf("! ");
 		print_status(sinfo->statusmask);
 	}
 
 	if(sinfo->flags & IPT_CONNTRACK_EXPIRES) {
 		printf("%sctexpire ", optpfx);
         	if (sinfo->invflags & IPT_CONNTRACK_EXPIRES)
-                	fputc('!', stdout);
+                	printf("! ");
 
         	if (sinfo->expires_max == sinfo->expires_min)
                 	printf("%lu ", sinfo->expires_min);
#1 lore raw
Quoted 2 lines · Michael Schwendt

libipt_conntrack.c in several places also lacks a white-space character after the '!' prefix of an invertable argument.

thanks, patch applied.

Signature · 5 lines
Live long and prosper
- Harald Welte / [email protected]               http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- 
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)