]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
wireguard.cgi: Fix connection status for RW connections
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Dec 2024 13:30:20 +0000 (14:30 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Apr 2025 14:48:53 +0000 (16:48 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/wireguard.cgi

index c07acb5f96a273049c6f5f3cfa7207bffa0a1f6c..d27efc8eeedf448b48762f1d7ffbacd43ab33e64 100644 (file)
@@ -602,6 +602,9 @@ END
                                </tr>
 END
 
+               # Dump all RW peers
+               my %DUMP = &Wireguard::dump("wg0");
+
                # Iterate through all peers...
                foreach my $key (sort { $Wireguard::peers{$a}[2] cmp $Wireguard::peers{$b}[2] } keys %Wireguard::peers) {
                        my $enabled  = $Wireguard::peers{$key}[0];
@@ -623,7 +626,7 @@ END
                        my @status = ("status");
 
                        # Fetch the dump
-                       my %dump = &Wireguard::dump("wg$key");
+                       my %dump = ($type eq "net") ? &Wireguard::dump("wg$key") : %DUMP;
 
                        # Fetch the status of the peer (if possible)
                        my $status = $dump{$pubkey} || ();