From 8a4cbfb0aaec6f23c576815e467c60f71e1e8e91 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 4 Jan 2019 15:15:07 +0100 Subject: net: ip_route_get: Fix error message We do getopt(), so the next argument is in argv[optind], not in argv[1]. Signed-off-by: Sascha Hauer --- commands/ip-route-get.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'commands') diff --git a/commands/ip-route-get.c b/commands/ip-route-get.c index d393218188..7c304694db 100644 --- a/commands/ip-route-get.c +++ b/commands/ip-route-get.c @@ -42,8 +42,8 @@ static int do_ip_route_get(int argc, char *argv[]) ret = string_to_ip(argv[optind], &ip); if (ret) { - printf("Cannot convert %s into a IP address: %s\n", - argv[1], strerror(-ret)); + printf("Cannot convert \"%s\" into a IP address: %s\n", + argv[optind], strerror(-ret)); return 1; } -- cgit v1.2.3 From eb3c1d18a0309456fbd0e6b12eaa76f1faaa3a19 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 4 Jan 2019 15:17:50 +0100 Subject: net: ip_route_get: Hook help text to command The help text is present but not hooked into the command structure. Fix this. Signed-off-by: Sascha Hauer --- commands/ip-route-get.c | 1 + 1 file changed, 1 insertion(+) (limited to 'commands') diff --git a/commands/ip-route-get.c b/commands/ip-route-get.c index 7c304694db..b3d4ecce82 100644 --- a/commands/ip-route-get.c +++ b/commands/ip-route-get.c @@ -93,4 +93,5 @@ BAREBOX_CMD_START(ip_route_get) BAREBOX_CMD_OPTS("[-b] [variable]") BAREBOX_CMD_GROUP(CMD_GRP_MISC) BAREBOX_CMD_COMPLETE(empty_complete) + BAREBOX_CMD_HELP(cmd_ip_route_get_help) BAREBOX_CMD_END -- cgit v1.2.3 From 78b1d0fa1ec8f6283e514d4d68ad08fc0f16a578 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 4 Jan 2019 16:14:28 +0100 Subject: net: ip_route_get: resolv hostnames When global.net.server is a hostname instead of an IP address we have to resolv it. Signed-off-by: Sascha Hauer --- commands/ip-route-get.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/ip-route-get.c b/commands/ip-route-get.c index b3d4ecce82..d3c15b7798 100644 --- a/commands/ip-route-get.c +++ b/commands/ip-route-get.c @@ -40,7 +40,7 @@ static int do_ip_route_get(int argc, char *argv[]) if (argc == optind + 2) variable = argv[optind + 1]; - ret = string_to_ip(argv[optind], &ip); + ret = resolv(argv[optind], &ip); if (ret) { printf("Cannot convert \"%s\" into a IP address: %s\n", argv[optind], strerror(-ret)); -- cgit v1.2.3