From 41e8a19ea9934eac5c8ca53e786be88e6e9d1bd7 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Sun, 23 Jun 2002 08:03:12 +0000 Subject: *** empty log message *** --- extensions/ebt_redirect.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'extensions/ebt_redirect.c') diff --git a/extensions/ebt_redirect.c b/extensions/ebt_redirect.c index 3dff790..1fc7fd8 100644 --- a/extensions/ebt_redirect.c +++ b/extensions/ebt_redirect.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include "../include/ebtables_u.h" #include @@ -33,7 +32,6 @@ static void init(struct ebt_entry_target *target) return; } - #define OPT_REDIRECT_TARGET 0x01 static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry, unsigned int *flags, @@ -61,10 +59,10 @@ static int parse(int c, char **argv, int argc, } static void final_check(const struct ebt_u_entry *entry, - const struct ebt_entry_target *target, const char *name, unsigned int hook) + const struct ebt_entry_target *target, const char *name, unsigned int hook_mask) { - if ( (hook != NF_BR_PRE_ROUTING || strcmp(name, "nat")) && - (hook != NF_BR_BROUTING || strcmp(name, "broute")) ) + if ( ((hook_mask & ~(1 << NF_BR_PRE_ROUTING)) || strcmp(name, "nat")) && + ((hook_mask & ~(1 << NF_BR_BROUTING)) || strcmp(name, "broute")) ) print_error("Wrong chain for redirect"); } @@ -74,8 +72,10 @@ static void print(const struct ebt_u_entry *entry, struct ebt_redirect_info *redirectinfo = (struct ebt_redirect_info *)target->data; - printf("redirect"); - printf(" --redirect-target %s", standard_targets[redirectinfo->target]); + if (redirectinfo->target == EBT_ACCEPT) + return; + printf(" --redirect-target %s", + standard_targets[-redirectinfo->target - 1]); } static int compare(const struct ebt_entry_target *t1, -- cgit v1.2.3