summaryrefslogtreecommitdiffstats
path: root/iptables.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2008-05-12 18:53:16 +0000
committer/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2008-05-12 18:53:16 +0000
commit6a10cb1a5848240c2946f9c24bf82b0f8efb8e4e (patch)
tree2f90bfc61f9b4b30e9a8e5b2c5c49a725e7ce281 /iptables.c
parenta147b181aca3cdbfa634a03f739efb15e2d078c0 (diff)
[patch 2/4] Add support for --set-counters to iptables -P
Adds support for setting the policy counters iptables -P INPUT -J DROP -c 10 20 Henrik Nordstrom <henrik@henriknordstrom.net>
Diffstat (limited to 'iptables.c')
-rw-r--r--iptables.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/iptables.c b/iptables.c
index db97d08..8c876d2 100644
--- a/iptables.c
+++ b/iptables.c
@@ -165,7 +165,7 @@ static char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
/*ZERO*/ {'x','x','x','x','x',' ','x','x','x','x','x','x'},
/*NEW_CHAIN*/ {'x','x','x','x','x',' ','x','x','x','x','x','x'},
/*DEL_CHAIN*/ {'x','x','x','x','x',' ','x','x','x','x','x','x'},
-/*SET_POLICY*/{'x','x','x','x','x',' ','x','x','x','x','x','x'},
+/*SET_POLICY*/{'x','x','x','x','x',' ','x','x','x','x','x',' '},
/*RENAME*/ {'x','x','x','x','x',' ','x','x','x','x','x','x'}
};
@@ -1842,7 +1842,7 @@ int do_command(int argc, char *argv[], char **table, iptc_handle_t *handle)
ret = iptc_rename_chain(chain, newname, handle);
break;
case CMD_SET_POLICY:
- ret = iptc_set_policy(chain, policy, NULL, handle);
+ ret = iptc_set_policy(chain, policy, options&OPT_COUNTERS ? &fw.counters : NULL, handle);
break;
default:
/* We should never reach this... */