diff options
author | buytenh <buytenh> | 2001-12-07 14:27:43 +0000 |
---|---|---|
committer | buytenh <buytenh> | 2001-12-07 14:27:43 +0000 |
commit | 757498e8e254e269d05a4e03ae80db5eb4377d40 (patch) | |
tree | 4f27e4dc2e60ff158ab3d2d752485d39afab93c1 /brctl/brctl_cmd.c | |
parent | b2282c7ff1059ed1915a69a5fe41d9049c7b14c4 (diff) | |
download | android_external_brctl-757498e8e254e269d05a4e03ae80db5eb4377d40.tar.gz android_external_brctl-757498e8e254e269d05a4e03ae80db5eb4377d40.tar.bz2 android_external_brctl-757498e8e254e269d05a4e03ae80db5eb4377d40.zip |
Check if correct number of arguments given to an option.
Handle ELOOP return condition from br_add_bridge.
Diffstat (limited to 'brctl/brctl_cmd.c')
-rw-r--r-- | brctl/brctl_cmd.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/brctl/brctl_cmd.c b/brctl/brctl_cmd.c index 03d1fc6..264a27d 100644 --- a/brctl/brctl_cmd.c +++ b/brctl/brctl_cmd.c @@ -89,6 +89,12 @@ void br_cmd_addif(struct bridge *br, char *ifname, char *arg1) br->ifname); break; + case ELOOP: + fprintf(stderr, "device %s is a bridge device itself; " + "can't enslave a bridge device to a bridge device.\n", + ifname); + break; + default: perror("br_add_interface"); break; @@ -295,22 +301,22 @@ void br_cmd_showmacs(struct bridge *br, char *arg0, char *arg1) } static struct command commands[] = { - {0, "addbr", br_cmd_addbr}, - {1, "addif", br_cmd_addif}, - {0, "delbr", br_cmd_delbr}, - {1, "delif", br_cmd_delif}, - {1, "setageing", br_cmd_setageing}, - {1, "setbridgeprio", br_cmd_setbridgeprio}, - {1, "setfd", br_cmd_setfd}, - {1, "setgcint", br_cmd_setgcint}, - {1, "sethello", br_cmd_sethello}, - {1, "setmaxage", br_cmd_setmaxage}, - {1, "setpathcost", br_cmd_setpathcost}, - {1, "setportprio", br_cmd_setportprio}, - {0, "show", br_cmd_show}, - {1, "showmacs", br_cmd_showmacs}, - {1, "showstp", br_cmd_showstp}, - {1, "stp", br_cmd_stp}, + {0, 1, "addbr", br_cmd_addbr}, + {1, 1, "addif", br_cmd_addif}, + {0, 1, "delbr", br_cmd_delbr}, + {1, 1, "delif", br_cmd_delif}, + {1, 1, "setageing", br_cmd_setageing}, + {1, 1, "setbridgeprio", br_cmd_setbridgeprio}, + {1, 1, "setfd", br_cmd_setfd}, + {1, 1, "setgcint", br_cmd_setgcint}, + {1, 1, "sethello", br_cmd_sethello}, + {1, 1, "setmaxage", br_cmd_setmaxage}, + {1, 2, "setpathcost", br_cmd_setpathcost}, + {1, 2, "setportprio", br_cmd_setportprio}, + {0, 0, "show", br_cmd_show}, + {1, 0, "showmacs", br_cmd_showmacs}, + {1, 0, "showstp", br_cmd_showstp}, + {1, 1, "stp", br_cmd_stp}, }; struct command *br_command_lookup(char *cmd) |