From 341eb00a821c4254ddd04968beed2e98e5a33aff Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 3 May 2025 15:10:16 +0200 Subject: [PATCH] fwhosts.cgi: Correctly show IP addresses for WireGuard RW peers Signed-off-by: Michael Tremer --- html/cgi-bin/fwhosts.cgi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 67a0f863a..e92ef6853 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -3027,11 +3027,15 @@ sub getipforgroup my $peer = &Wireguard::get_peer_by_name($name); if (defined $peer) { + my @addresses = (); + if ($peer->{"TYPE"} eq "host") { - return $peer->{"CLIENT_ADDRESS"}; + push(@addresses, @{ $peer->{"CLIENT_ADDRESS"} }); } elsif ($peer->{"TYPE"} eq "net") { - return join(", ", @{ $peer->{"REMOTE_SUBNETS"} }); + push(@addresses, @{ $peer->{"REMOTE_SUBNETS"} }); } + + return join(", ", @addresses); } } -- 2.39.5