Commit 6843d36e authored by Zhang Shengju's avatar Zhang Shengju Committed by Stephen Hemminger

ip-link: cut one level indentation

Cut one level indentation to make things easier to read.
Signed-off-by: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
parent e3c27c2d
......@@ -1184,40 +1184,41 @@ static void do_help(int argc, char **argv)
int do_iplink(int argc, char **argv)
{
if (argc > 0) {
if (iplink_have_newlink()) {
if (matches(*argv, "add") == 0)
return iplink_modify(RTM_NEWLINK,
NLM_F_CREATE|NLM_F_EXCL,
argc-1, argv+1);
if (matches(*argv, "set") == 0 ||
matches(*argv, "change") == 0)
return iplink_modify(RTM_NEWLINK, 0,
argc-1, argv+1);
if (matches(*argv, "replace") == 0)
return iplink_modify(RTM_NEWLINK,
NLM_F_CREATE|NLM_F_REPLACE,
argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return iplink_modify(RTM_DELLINK, 0,
argc-1, argv+1);
} else {
if (argc < 1)
return ipaddr_list_link(0, NULL);
if (iplink_have_newlink()) {
if (matches(*argv, "add") == 0)
return iplink_modify(RTM_NEWLINK,
NLM_F_CREATE|NLM_F_EXCL,
argc-1, argv+1);
if (matches(*argv, "set") == 0 ||
matches(*argv, "change") == 0)
return iplink_modify(RTM_NEWLINK, 0,
argc-1, argv+1);
if (matches(*argv, "replace") == 0)
return iplink_modify(RTM_NEWLINK,
NLM_F_CREATE|NLM_F_REPLACE,
argc-1, argv+1);
if (matches(*argv, "delete") == 0)
return iplink_modify(RTM_DELLINK, 0,
argc-1, argv+1);
} else {
#if IPLINK_IOCTL_COMPAT
if (matches(*argv, "set") == 0)
return do_set(argc-1, argv+1);
if (matches(*argv, "set") == 0)
return do_set(argc-1, argv+1);
#endif
}
if (matches(*argv, "show") == 0 ||
matches(*argv, "lst") == 0 ||
matches(*argv, "list") == 0)
return ipaddr_list_link(argc-1, argv+1);
if (matches(*argv, "help") == 0) {
do_help(argc-1, argv+1);
return 0;
}
} else
return ipaddr_list_link(0, NULL);
}
if (matches(*argv, "show") == 0 ||
matches(*argv, "lst") == 0 ||
matches(*argv, "list") == 0)
return ipaddr_list_link(argc-1, argv+1);
if (matches(*argv, "help") == 0) {
do_help(argc-1, argv+1);
return 0;
}
fprintf(stderr, "Command \"%s\" is unknown, try \"ip link help\".\n", *argv);
fprintf(stderr, "Command \"%s\" is unknown, try \"ip link help\".\n",
*argv);
exit(-1);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment