mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-16 22:45:17 +08:00
ip-link: remove unnecessary return
Remove unnecessary retrun, because invarg() exit. Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
This commit is contained in:
parent
4e972d5ef4
commit
6a9ce30e78
@ -42,47 +42,41 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
|
||||
while (argc > 0) {
|
||||
if (matches(*argv, "forward_delay") == 0) {
|
||||
NEXT_ARG();
|
||||
if (get_u32(&val, *argv, 0)) {
|
||||
if (get_u32(&val, *argv, 0))
|
||||
invarg("invalid forward_delay", *argv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
addattr32(n, 1024, IFLA_BR_FORWARD_DELAY, val);
|
||||
} else if (matches(*argv, "hello_time") == 0) {
|
||||
NEXT_ARG();
|
||||
if (get_u32(&val, *argv, 0)) {
|
||||
if (get_u32(&val, *argv, 0))
|
||||
invarg("invalid hello_time", *argv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
addattr32(n, 1024, IFLA_BR_HELLO_TIME, val);
|
||||
} else if (matches(*argv, "max_age") == 0) {
|
||||
NEXT_ARG();
|
||||
if (get_u32(&val, *argv, 0)) {
|
||||
if (get_u32(&val, *argv, 0))
|
||||
invarg("invalid max_age", *argv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
addattr32(n, 1024, IFLA_BR_MAX_AGE, val);
|
||||
} else if (matches(*argv, "ageing_time") == 0) {
|
||||
NEXT_ARG();
|
||||
if (get_u32(&val, *argv, 0)) {
|
||||
if (get_u32(&val, *argv, 0))
|
||||
invarg("invalid ageing_time", *argv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
addattr32(n, 1024, IFLA_BR_AGEING_TIME, val);
|
||||
} else if (matches(*argv, "stp_state") == 0) {
|
||||
NEXT_ARG();
|
||||
if (get_u32(&val, *argv, 0)) {
|
||||
if (get_u32(&val, *argv, 0))
|
||||
invarg("invalid stp_state", *argv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
addattr32(n, 1024, IFLA_BR_STP_STATE, val);
|
||||
} else if (matches(*argv, "priority") == 0) {
|
||||
__u16 prio;
|
||||
|
||||
NEXT_ARG();
|
||||
if (get_u16(&prio, *argv, 0)) {
|
||||
if (get_u16(&prio, *argv, 0))
|
||||
invarg("invalid priority", *argv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
addattr16(n, 1024, IFLA_BR_PRIORITY, prio);
|
||||
} else if (matches(*argv, "help") == 0) {
|
||||
explain();
|
||||
|
Loading…
Reference in New Issue
Block a user