All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gáspár Lajos" <swifty@freemail.hu>
To: Netfilter list <netfilter@vger.kernel.org>,
	Jan Engelhardt <jengelh@medozas.de>
Subject: libxt_conntrack.c ctdir patch
Date: Wed, 29 Oct 2008 14:41:16 +0100	[thread overview]
Message-ID: <490867FC.5090504@freemail.hu> (raw)

[-- 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,

                 reply	other threads:[~2008-10-29 13:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=490867FC.5090504@freemail.hu \
    --to=swifty@freemail.hu \
    --cc=jengelh@medozas.de \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.