diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inspsocket.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 620f11737..5641ba6ef 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -190,6 +190,7 @@ bool InspSocket::BindAddr(const std::string &ip) if (inet_pton(AF_INET6, IP.c_str(), &n) > 0) { memcpy(&((sockaddr_in6*)s)->sin6_addr, &n, sizeof(n)); + ((sockaddr_in6*)s)->sin6_port = 0; ((sockaddr_in6*)s)->sin6_family = AF_INET6; size = sizeof(sockaddr_in6); } @@ -206,6 +207,7 @@ bool InspSocket::BindAddr(const std::string &ip) if (inet_aton(IP.c_str(), &n) > 0) { ((sockaddr_in*)s)->sin_addr = n; + ((sockaddr_in*)s)->sin_port = 0; ((sockaddr_in*)s)->sin_family = AF_INET; } else @@ -220,6 +222,7 @@ bool InspSocket::BindAddr(const std::string &ip) if (insp_aton(IP.c_str(), &n) > 0) { ((sockaddr_in*)s)->sin_addr = n; + ((sockaddr_in*)s)->sin_port = 0; ((sockaddr_in*)s)->sin_family = AF_INET; } else |