summaryrefslogtreecommitdiffstats
path: root/ebtables.c
diff options
context:
space:
mode:
Diffstat (limited to 'ebtables.c')
-rw-r--r--ebtables.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ebtables.c b/ebtables.c
index 2b0807f..08a9e57 100644
--- a/ebtables.c
+++ b/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)