From: Dmitry Selivanov Date: Wed, 8 Feb 2023 06:30:16 +0000 (+0300) Subject: show: fix show all endpoints output X-Git-Tag: v1.0.20250521~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4f6b4f229d291daf7c35c6f1e7f4841cc6d69bc;p=thirdparty%2Fwireguard-tools.git show: fix show all endpoints output Currently "wg show all endpoints" prints interface name only once while other "show all" commands print it on each line as man says. Signed-off-by: Dmitry Selivanov Signed-off-by: Jason A. Donenfeld --- diff --git a/src/show.c b/src/show.c index 3fd3d9e..13777cf 100644 --- a/src/show.c +++ b/src/show.c @@ -312,9 +312,9 @@ static bool ugly_print(struct wgdevice *device, const char *param, bool with_int else printf("off\n"); } else if (!strcmp(param, "endpoints")) { - if (with_interface) - printf("%s\t", device->name); for_each_wgpeer(device, peer) { + if (with_interface) + printf("%s\t", device->name); printf("%s\t", key(peer->public_key)); if (peer->endpoint.addr.sa_family == AF_INET || peer->endpoint.addr.sa_family == AF_INET6) printf("%s\n", endpoint(&peer->endpoint.addr));