Development discussion of WireGuard
 help / color / mirror / Atom feed
* [PATCH] wg: Fix show all endpoints output
@ 2023-01-29  8:46 Dmitry Selivanov
  2023-02-07 22:56 ` Jason A. Donenfeld
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Selivanov @ 2023-01-29  8:46 UTC (permalink / raw)
  To: wireguard

Currently "wg show all endpoints" prints interface name only once
while other "show all" commands print it on each line as man says.
---
 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));
-- 
2.30.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-08 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29  8:46 [PATCH] wg: Fix show all endpoints output Dmitry Selivanov
2023-02-07 22:56 ` Jason A. Donenfeld
2023-02-08  6:30   ` Dmitry Selivanov
2023-02-08 16:48     ` Jason A. Donenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).