aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/wg.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-15 22:52:38 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-17 19:26:07 +0200
commit38e97ddeab325936f2498faeb3b6866f74cad285 (patch)
treec9cc1a3858ee54d65fbec45068daf3a7253f33d1 /src/tools/wg.c
parenttools: encoding: be more paranoid (diff)
downloadwireguard-monolithic-historical-38e97ddeab325936f2498faeb3b6866f74cad285.tar.xz
wireguard-monolithic-historical-38e97ddeab325936f2498faeb3b6866f74cad285.zip
tools: retry resolution except when fatal
The reference to this is <https://sourceware.org/glibc/wiki/NameResolver>, which mentions: "From the perspective of the application that calls getaddrinfo() it perhaps doesn't matter that much since EAI_FAIL, EAI_NONAME and EAI_NODATA are all permanent failure codes and the causes are all permanent failures in the sense that there is no point in retrying later." This should cover more early-boot situations. While we're at it, we clean up the logic a bit so that we don't have a retry message on the final non-retrying attempt. We also peer into errno when receiving EAI_SYSTEM, to report to the user what actually happened. Also, fix the quoting back tick front tick mess.
Diffstat (limited to '')
-rw-r--r--src/tools/wg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/wg.c b/src/tools/wg.c
index e1d9a60..c340d66 100644
--- a/src/tools/wg.c
+++ b/src/tools/wg.c
@@ -14,7 +14,7 @@ static const struct {
const char *description;
} subcommands[] = {
{ "show", show_main, "Shows the current configuration and device information" },
- { "showconf", showconf_main, "Shows the current configuration of a given WireGuard interface, for use with `setconf`" },
+ { "showconf", showconf_main, "Shows the current configuration of a given WireGuard interface, for use with `setconf'" },
{ "set", set_main, "Change the current configuration, add peers, remove peers, or change peers" },
{ "setconf", setconf_main, "Applies a configuration file to a WireGuard interface" },
{ "addconf", setconf_main, "Appends a configuration file to a WireGuard interface" },
@@ -61,7 +61,7 @@ findsubcommand:
goto findsubcommand;
}
- fprintf(stderr, "Invalid subcommand: `%s`\n", argv[1]);
+ fprintf(stderr, "Invalid subcommand: `%s'\n", argv[1]);
show_usage(stderr);
return 1;
}