From 14f5854ecfb7b66d407c3a143906aa4c2a3d979e Mon Sep 17 00:00:00 2001 From: Yihong Wu <54519668+domosekai@users.noreply.github.com> Date: Tue, 7 Dec 2021 15:48:32 +0800 Subject: [PATCH] Fix IPv6 address display in session info dialog --- src/Cedar/Command.c | 2 +- src/Cedar/SM.c | 2 +- src/Mayaqua/Network.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cedar/Command.c b/src/Cedar/Command.c index 67ebc4b5..df188b6f 100644 --- a/src/Cedar/Command.c +++ b/src/Cedar/Command.c @@ -18969,7 +18969,7 @@ UINT PsSessionGet(CONSOLE *c, char *cmd_name, wchar_t *str, void *param) char str[MAX_SIZE]; CT *ct = CtNewStandard(); - if (t.ClientIp != 0) + if (t.ClientIp != 0 || IsZero(t.ClientIp6, sizeof(t.ClientIp6)) == false) { IPToStr4or6(str, sizeof(str), t.ClientIp, t.ClientIp6); StrToUni(tmp, sizeof(tmp), str); diff --git a/src/Cedar/SM.c b/src/Cedar/SM.c index d8954ffd..5e8ab700 100644 --- a/src/Cedar/SM.c +++ b/src/Cedar/SM.c @@ -9614,7 +9614,7 @@ bool SmRefreshSessionStatus(HWND hWnd, SM_SERVER *s, void *param) b = LvInsertStart(); - if (t.ClientIp != 0) + if (t.ClientIp != 0 || IsZero(t.ClientIp6, sizeof(t.ClientIp6)) == false) { IPToStr4or6(str, sizeof(str), t.ClientIp, t.ClientIp6); StrToUni(tmp, sizeof(tmp), str); diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index 5bbda204..4fcef64d 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -14861,7 +14861,7 @@ SOCK *NewSock() UINT IPToUINT(IP *ip) { // Validate arguments - if (ip == NULL) + if (ip == NULL || IsIP6(ip)) { return 0; }