Skip to contentSkip to conversation

ctproto printing in conntrack match (bug 398)

PATCH In review Phil Oester 2 participants 2 messages Nov 13, 2005 – Nov 17, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ctproto printing in conntrack match (bug 398)

The conntrack match does not print any info for --ctproto, thus breaking iptables-restore of any rules using this option. Below patch adds output and closes bug #398.

Phil

extensions/libipt_conntrack.c +7 -0
diff -ru ipt-orig/extensions/libipt_conntrack.c ipt-new/extensions/libipt_conntrack.c
@@ -442,6 +442,13 @@
 		print_state(sinfo->statemask);
 	}
 
+	if(sinfo->flags & IPT_CONNTRACK_PROTO) {
+		printf("%sctproto ", optpfx);
+        	if (sinfo->invflags & IPT_CONNTRACK_PROTO)
+                	printf("! ");
+		printf("%u ", sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum);
+	}
+
 	if(sinfo->flags & IPT_CONNTRACK_ORIGSRC) {
 		printf("%sctorigsrc ", optpfx);
 
#1 lore raw
Quoted 3 lines · Phil Oester

The conntrack match does not print any info for --ctproto, thus breaking iptables-restore of any rules using this option. Below patch adds output and closes bug #398.

Thanks, Phil. Committed revision 4543.

Thanks also for your valuable work in hunting down bugzilla bugs in general.

Signature · 5 lines
- Harald Welte <[email protected]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie