summaryrefslogtreecommitdiff
path: root/server/FwmarkServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/FwmarkServer.cpp')
-rw-r--r--server/FwmarkServer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/FwmarkServer.cpp b/server/FwmarkServer.cpp
index c97ae774..7c2b2270 100644
--- a/server/FwmarkServer.cpp
+++ b/server/FwmarkServer.cpp
@@ -212,8 +212,10 @@ int FwmarkServer::processClient(SocketClient* client, int* socketFd) {
mEventReporter->getNetdEventListener();
if (netdEventListener != nullptr) {
- char addrstr[INET6_ADDRSTRLEN];
- char portstr[sizeof("65536")];
+ char addrstr[INET6_ADDRSTRLEN + IFNAMSIZ]; // ipv6 address + optional %scope
+ char portstr[sizeof("65535")];
+ static_assert(sizeof(addrstr) >= 62);
+ static_assert(sizeof(portstr) >= 6);
const int ret = getnameinfo(&connectInfo.addr.s, sizeof(connectInfo.addr.s),
addrstr, sizeof(addrstr), portstr, sizeof(portstr),
NI_NUMERICHOST | NI_NUMERICSERV);