All of lore.kernel.org
 help / color / mirror / Atom feed
* libxt_conntrack.c ctdir patch
@ 2008-10-29 13:41 Gáspár Lajos
  0 siblings, 0 replies; only message in thread
From: Gáspár Lajos @ 2008-10-29 13:41 UTC (permalink / raw)
  To: Netfilter list, Jan Engelhardt

[-- Attachment #1: Type: text/plain, Size: 47 bytes --]

A bit cleanup and support for ctdir...

Swifty

[-- Attachment #2: libxt_contrack.c.patch --]
[-- Type: text/x-diff, Size: 2313 bytes --]

--- extensions/libxt_conntrack.c.old	2008-09-02 06:28:38.000000000 +0200
+++ extensions/libxt_conntrack.c	2008-10-29 14:33:57.000000000 +0100
@@ -293,10 +293,9 @@
 	struct in_addr *addrs = NULL;
 
 
+	check_inverse(optarg, &invert, &optind, 0);
 	switch (c) {
 	case '1':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		parse_states(argv[optind-1], sinfo);
 		if (invert) {
 			sinfo->invflags |= XT_CONNTRACK_STATE;
@@ -305,8 +304,6 @@
 		break;
 
 	case '2':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		if(invert)
 			sinfo->invflags |= XT_CONNTRACK_PROTO;
 
@@ -326,8 +323,6 @@
 		break;
 
 	case '3':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		if (invert)
 			sinfo->invflags |= XT_CONNTRACK_ORIGSRC;
 
@@ -346,8 +341,6 @@
 		break;
 
 	case '4':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		if (invert)
 			sinfo->invflags |= XT_CONNTRACK_ORIGDST;
 
@@ -366,8 +359,6 @@
 		break;
 
 	case '5':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		if (invert)
 			sinfo->invflags |= XT_CONNTRACK_REPLSRC;
 
@@ -386,8 +377,6 @@
 		break;
 
 	case '6':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		if (invert)
 			sinfo->invflags |= XT_CONNTRACK_REPLDST;
 
@@ -406,8 +395,6 @@
 		break;
 
 	case '7':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		parse_statuses(argv[optind-1], sinfo);
 		if (invert) {
 			sinfo->invflags |= XT_CONNTRACK_STATUS;
@@ -416,8 +403,6 @@
 		break;
 
 	case '8':
-		check_inverse(optarg, &invert, &optind, 0);
-
 		parse_expires(argv[optind-1], sinfo);
 		if (invert) {
 			sinfo->invflags |= XT_CONNTRACK_EXPIRES;
@@ -873,6 +858,14 @@
         	else
                 	printf("%lu:%lu ", sinfo->expires_min, sinfo->expires_max);
 	}
+
+	if(sinfo->flags & XT_CONNTRACK_DIRECTION) {
+		if (sinfo->invflags & XT_CONNTRACK_DIRECTION)
+			printf("%sctdir REPLY", optpfx);
+		else
+			printf("%sctdir ORIGINAL", optpfx);
+	}
+
 }
 
 static void
@@ -970,6 +963,13 @@
 			printf("%u:%u ", (unsigned int)info->expires_min,
 			       (unsigned int)info->expires_max);
 	}
+
+	if(info->match_flags & XT_CONNTRACK_DIRECTION) {
+		if (info->invert_flags & XT_CONNTRACK_DIRECTION)
+			printf("%sctdir REPLY", prefix);
+		else
+			printf("%sctdir ORIGINAL", prefix);
+	}
 }
 
 static void conntrack_print(const void *ip, const struct xt_entry_match *match,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-29 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 13:41 libxt_conntrack.c ctdir patch Gáspár Lajos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.