summaryrefslogtreecommitdiffstats
path: root/userspace/ebtables2/extensions/ebt_redirect.c
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2002-06-23 08:03:12 +0000
committerBart De Schuymer <bdschuym@pandora.be>2002-06-23 08:03:12 +0000
commit0ceadf9abe94b3774b0b1fa7af9d9d932af8c9c3 (patch)
tree961ede8e4ce64048528844c5526b8a6040340c23 /userspace/ebtables2/extensions/ebt_redirect.c
parentcd54b43d64f35286514cd7742dde0f1e1e2b8843 (diff)
*** empty log message ***
Diffstat (limited to 'userspace/ebtables2/extensions/ebt_redirect.c')
-rw-r--r--userspace/ebtables2/extensions/ebt_redirect.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/userspace/ebtables2/extensions/ebt_redirect.c b/userspace/ebtables2/extensions/ebt_redirect.c
index 3dff790..1fc7fd8 100644
--- a/userspace/ebtables2/extensions/ebt_redirect.c
+++ b/userspace/ebtables2/extensions/ebt_redirect.c
@@ -3,7 +3,6 @@
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <linux/netfilter_bridge/ebtables.h>
#include <getopt.h>
#include "../include/ebtables_u.h"
#include <linux/netfilter_bridge/ebt_redirect.h>
@@ -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,