lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1439522021-22613-1-git-send-email-zhangshengju@cmss.chinamobile.com>
Date:	Fri, 14 Aug 2015 03:13:41 +0000
From:	Zhang Shengju <zhangshengju@...s.chinamobile.com>
To:	netdev@...r.kernel.org
Subject: [PATCH iproute2] ip-link: cut one level indentation

Cut one level indentation to make things easier to read.

Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
---
 ip/iplink.c | 65 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 33 insertions(+), 32 deletions(-)

diff --git a/ip/iplink.c b/ip/iplink.c
index 520f750..504aa74 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -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);
 }
-- 
1.8.3.1



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ