From b852afe9092b9d6b1d96fd1f73c90270eaf3a9e3 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Wed, 20 Nov 2024 20:38:48 +0100 Subject: [PATCH] OF-2729: Admin console S2S 'family' should evaluate both in- and outbound connections --- .../src/main/webapp/server-session-row.jspf | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/xmppserver/src/main/webapp/server-session-row.jspf b/xmppserver/src/main/webapp/server-session-row.jspf index a7a2c93dbc..8744a1b1d1 100644 --- a/xmppserver/src/main/webapp/server-session-row.jspf +++ b/xmppserver/src/main/webapp/server-session-row.jspf @@ -79,20 +79,37 @@ <% } %> <% - final boolean hasIPv4 = inSessions.stream().anyMatch(s-> { + final boolean hasInIPv4 = inSessions.stream().anyMatch(s-> { try { return InetAddress.getByName(s.getHostAddress()) instanceof Inet4Address; } catch (UnknownHostException e) { return false; } }); - final boolean hasIPv6 = inSessions.stream().anyMatch(s-> { + final boolean hasOutIPv4 = outSessions.stream().anyMatch(s-> { + try { + return InetAddress.getByName(s.getHostAddress()) instanceof Inet4Address; + } catch (UnknownHostException e) { + return false; + } + }); + + final boolean hasInIPv6 = inSessions.stream().anyMatch(s-> { + try { + return InetAddress.getByName(s.getHostAddress()) instanceof Inet6Address; + } catch (UnknownHostException e) { + return false; + } + }); + final boolean hasOutIPv6 = outSessions.stream().anyMatch(s-> { try { return InetAddress.getByName(s.getHostAddress()) instanceof Inet6Address; } catch (UnknownHostException e) { return false; } }); + final boolean hasIPv4 = hasInIPv4 || hasOutIPv4; + final boolean hasIPv6 = hasInIPv6 || hasOutIPv6; %> <% if (hasIPv4 && hasIPv6) { %>