From b4f6b4f229d291daf7c35c6f1e7f4841cc6d69bc Mon Sep 17 00:00:00 2001 From: Dmitry Selivanov Date: Wed, 8 Feb 2023 09:30:16 +0300 Subject: 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 --- src/show.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); -- cgit v1.2.3-59-g8ed1b