summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_CT.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@inai.de>2012-09-04 05:38:48 +0200
committerJan Engelhardt <jengelh@inai.de>2012-09-29 23:14:43 +0200
commit50f19190a60ff7d69e88406a71a2f27e09008566 (patch)
treeae45a384124ef654af088a158bd5e49efb7df554 /extensions/libxt_CT.c
parentcd2f9bdbb7f9b737e5d640aafeb78bcd8e3a7adf (diff)
libxt_NOTRACK: replace as an alias to CT --notrack
Note that we do not need any print/save functions for the alias entries, since the real CT entry will handle this. Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Diffstat (limited to 'extensions/libxt_CT.c')
-rw-r--r--extensions/libxt_CT.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/extensions/libxt_CT.c b/extensions/libxt_CT.c
index 27a20e2e..a576a953 100644
--- a/extensions/libxt_CT.c
+++ b/extensions/libxt_CT.c
@@ -248,6 +248,20 @@ static void ct_save_v1(const void *ip, const struct xt_entry_target *target)
printf(" --zone %u", info->zone);
}
+static void notrack_ct0_tg_init(struct xt_entry_target *target)
+{
+ struct xt_ct_target_info *info = (void *)target->data;
+
+ info->flags = XT_CT_NOTRACK;
+}
+
+static void notrack_ct1_tg_init(struct xt_entry_target *target)
+{
+ struct xt_ct_target_info_v1 *info = (void *)target->data;
+
+ info->flags = XT_CT_NOTRACK;
+}
+
static struct xtables_target ct_target_reg[] = {
{
.family = NFPROTO_UNSPEC,
@@ -274,6 +288,32 @@ static struct xtables_target ct_target_reg[] = {
.x6_parse = ct_parse_v1,
.x6_options = ct_opts_v1,
},
+ {
+ .family = NFPROTO_UNSPEC,
+ .name = "NOTRACK",
+ .real_name = "CT",
+ .revision = 0,
+ .version = XTABLES_VERSION,
+ .size = XT_ALIGN(sizeof(struct xt_ct_target_info)),
+ .userspacesize = offsetof(struct xt_ct_target_info, ct),
+ .init = notrack_ct0_tg_init,
+ },
+ {
+ .family = NFPROTO_UNSPEC,
+ .name = "NOTRACK",
+ .real_name = "CT",
+ .revision = 1,
+ .version = XTABLES_VERSION,
+ .size = XT_ALIGN(sizeof(struct xt_ct_target_info_v1)),
+ .userspacesize = offsetof(struct xt_ct_target_info_v1, ct),
+ .init = notrack_ct1_tg_init,
+ },
+ {
+ .family = NFPROTO_UNSPEC,
+ .name = "NOTRACK",
+ .revision = 0,
+ .version = XTABLES_VERSION,
+ },
};
void _init(void)