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]
Date:	Thu, 14 Nov 2013 15:00:24 +0800
From:	Hangbin Liu <liuhangbin@...il.com>
To:	network dev <netdev@...r.kernel.org>
Cc:	Hangbin Liu <liuhangbin@...il.com>
Subject: [patch iproute2] lib/utils.c: should return correct error message

Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
---
 lib/utils.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/utils.c b/lib/utils.c
index 4e9c719..59221b2 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -487,7 +487,11 @@ int get_addr(inet_prefix *dst, const char *arg, int family)
 		exit(1);
 	}
 	if (get_addr_1(dst, arg, family)) {
-		fprintf(stderr, "Error: an inet address is expected rather than \"%s\".\n", arg);
+		// FIXME: Don't know how to handle AF_UNSPEC and AF_DECnet
+		if (family == AF_INET6)
+			fprintf(stderr, "Error: an inet6 address is expected rather than \"%s\".\n", arg);
+		else
+			fprintf(stderr, "Error: an inet address is expected rather than \"%s\".\n", arg);
 		exit(1);
 	}
 	return 0;
@@ -500,7 +504,11 @@ int get_prefix(inet_prefix *dst, char *arg, int family)
 		exit(1);
 	}
 	if (get_prefix_1(dst, arg, family)) {
-		fprintf(stderr, "Error: an inet prefix is expected rather than \"%s\".\n", arg);
+		// FIXME: Don't know how to handle AF_DECnet
+		if (family == AF_INET6)
+			fprintf(stderr, "Error: an inet6 prefix is expected rather than \"%s\".\n", arg);
+		else
+			fprintf(stderr, "Error: an inet prefix is expected rather than \"%s\".\n", arg);
 		exit(1);
 	}
 	return 0;
-- 
1.8.1.4

--
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