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

* Re: [PATCH] wg: Fix show all endpoints output
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Jason A. Donenfeld @ 2023-02-07 22:56 UTC (permalink / raw)
  To: Dmitry Selivanov; +Cc: wireguard

Thanks.

Can you send this with a `Signed-off-by:` line like every commit in
that repository does, please? Then I'll apply this.

Jason

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

* Re: [PATCH] wg: Fix show all endpoints output
  2023-02-07 22:56 ` Jason A. Donenfeld
@ 2023-02-08  6:30   ` Dmitry Selivanov
  2023-02-08 16:48     ` Jason A. Donenfeld
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Selivanov @ 2023-02-08  6:30 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: wireguard

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 <dseliv@gmail.com>
---
 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

* Re: [PATCH] wg: Fix show all endpoints output
  2023-02-08  6:30   ` Dmitry Selivanov
@ 2023-02-08 16:48     ` Jason A. Donenfeld
  0 siblings, 0 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2023-02-08 16:48 UTC (permalink / raw)
  To: Dmitry Selivanov; +Cc: wireguard

Applied, thanks.

https://git.zx2c4.com/wireguard-tools/commit/?id=b4f6b4f229d291daf7c35c6f1e7f4841cc6d69bc

^ 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).