summaryrefslogtreecommitdiffstats
path: root/userspace/ebtables2/ebtables.c
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2005-07-24 09:46:09 +0000
committerBart De Schuymer <bdschuym@pandora.be>2005-07-24 09:46:09 +0000
commitbb164972f9a8d967c486904371e4410a09b4e6a1 (patch)
treefef5561ebf9f79a382474c36d05c12f7e43ce514 /userspace/ebtables2/ebtables.c
parentbaa2ada77c0c1d98acbf3127bf7beefb651e788e (diff)
allow -I without rule number
Diffstat (limited to 'userspace/ebtables2/ebtables.c')
-rw-r--r--userspace/ebtables2/ebtables.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/userspace/ebtables2/ebtables.c b/userspace/ebtables2/ebtables.c
index 2b0807f..08a9e57 100644
--- a/userspace/ebtables2/ebtables.c
+++ b/userspace/ebtables2/ebtables.c
@@ -712,11 +712,13 @@ int do_command(int argc, char *argv[], int exec_style,
return -1;
} else if (c == 'I') {
if (optind >= argc || (argv[optind][0] == '-' && (argv[optind][1] < '0' || argv[optind][1] > '9')))
- ebt_print_error2("No rulenr for -I specified");
- rule_nr = strtol(argv[optind], &buffer, 10);
- if (*buffer != '\0')
- ebt_print_error2("Problem with the specified rule number '%s'", argv[optind]);
- optind++;
+ rule_nr = 1;
+ else {
+ rule_nr = strtol(argv[optind], &buffer, 10);
+ if (*buffer != '\0')
+ ebt_print_error2("Problem with the specified rule number '%s'", argv[optind]);
+ optind++;
+ }
} else if (c == 'P') {
handle_P:
if (optind >= argc)