iproute2: improved error messages
This patch improves many error messages as follows:
- For incorrect parameters, show the value of the offending parameter, rather than just say that it is incorrect
- Rephrased messages for clarity
- Rephrased to more `mainstream' english
Signed-off-by: Kees van Reeuwijk <reeuwijk@few.vu.nl>
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
index fcc9f33..216e982 100644
--- a/ip/ip6tunnel.c
+++ b/ip/ip6tunnel.c
@@ -128,7 +128,7 @@
strcmp(*argv, "any") == 0)
p->proto = 0;
else {
- fprintf(stderr,"Cannot guess tunnel mode.\n");
+ fprintf(stderr,"Unknown tunnel mode \"%s\"\n", *argv);
exit(-1);
}
} else if (strcmp(*argv, "remote") == 0) {
@@ -293,7 +293,7 @@
buf[sizeof(buf) - 1] = '\0';
if ((ptr = strchr(buf, ':')) == NULL ||
(*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
- fprintf(stderr, "Wrong format of /proc/net/dev. Sorry.\n");
+ fprintf(stderr, "Wrong format for /proc/net/dev. Giving up.\n");
goto end;
}
if (sscanf(ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld",
@@ -309,7 +309,7 @@
continue;
type = ll_index_to_type(index);
if (type == -1) {
- fprintf(stderr, "Failed to get type of [%s]\n", name);
+ fprintf(stderr, "Failed to get type of \"%s\"\n", name);
continue;
}
if (type != ARPHRD_TUNNEL6)
@@ -402,7 +402,7 @@
case AF_INET6:
break;
default:
- fprintf(stderr, "Unsupported family:%d\n", preferred_family);
+ fprintf(stderr, "Unsupported protocol family: %d\n", preferred_family);
exit(-1);
}