diff options
author | Bart De Schuymer <bdschuym@pandora.be> | 2005-07-24 09:46:09 +0000 |
---|---|---|
committer | Bart De Schuymer <bdschuym@pandora.be> | 2005-07-24 09:46:09 +0000 |
commit | 0158123b58273dd0af5a8bce8d883d218379a1d9 (patch) | |
tree | 31e407b8ee9ee73f4f1ed9f9d9d20791be153a35 /ebtables.c | |
parent | d3a05a7addb6c9731be7683ee4c732f108ddfacf (diff) |
allow -I without rule number
Diffstat (limited to 'ebtables.c')
-rw-r--r-- | ebtables.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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) |