]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_conntrack: dump ctdir
authorJan Engelhardt <jengelh@medozas.de>
Wed, 12 Nov 2008 11:03:25 +0000 (12:03 +0100)
committerPatrick McHardy <kaber@trash.net>
Wed, 12 Nov 2008 11:03:25 +0000 (12:03 +0100)
Sent in as part of a larger private mail by Gáspár Lajos
<swifty@freemail.hu>; I cherry-picked the ctdir part.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
extensions/libxt_conntrack.c

index 987e1af4397bdbfda8d99206fab1f37299066127..1e5f141a85c997bd82f6089f4d9d33743a7d3834 100644 (file)
@@ -879,6 +879,14 @@ matchinfo_print(const void *ip, const struct xt_entry_match *match, int numeric,
                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
@@ -976,6 +984,13 @@ conntrack_dump(const struct xt_conntrack_mtinfo1 *info, const char *prefix,
                        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,