summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:19 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:19 +0000
commitb796d975cfc6212fe689bda35440d60e2219e03d (patch)
treed6c0f2b027c73538b068142bbab330693b667430
parent5f4095e595fe36c6f83df96b7c59cb459b966ed3 (diff)
Return server port in GetPort rather than the arbitrary client port
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11576 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/usermanager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 14f022972..5dd9cb054 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -37,6 +37,12 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache
New->SetFd(socket);
memcpy(&New->ip, ip, sizeof(*ip));
+ // change the port number of their stored sockaddr to be the server port rather than the client port
+ if (New->ip.sa.sa_family == AF_INET6)
+ New->ip.in6.sin6_port = port;
+ else
+ New->ip.in4.sin_port = port;
+
/* Give each of the modules an attempt to hook the user for I/O */
FOREACH_MOD_I(Instance, I_OnHookUserIO, OnHookUserIO(New, targetip));