From 56fc9a6b8b30f5c88120e1ddabcfdc92ae494dbe Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 19 Apr 2007 18:51:28 +0000 Subject: Fix for bug #261 - Needs QA'ing. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6813 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspsocket.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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 -- cgit v1.2.3