From 08e43ffb21ffc99ee3616f62f48850ac32c281ef Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 2 Mar 2016 16:32:27 -0600 Subject: [PATCH] connect: fix tmpport handling --- modules/m_connect.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/m_connect.c b/modules/m_connect.c index 81cb53e99..8d31597ae 100644 --- a/modules/m_connect.c +++ b/modules/m_connect.c @@ -110,7 +110,7 @@ mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour * use the default form configuration structure. If missing * from there, then use the precompiled default. */ - tmpport = port = 0; + port = 0; if(parc > 2 && !EmptyString(parv[2])) port = atoi(parv[2]); if(port == 0 && server_p->port) @@ -127,7 +127,9 @@ mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour ilog(L_SERVER, "CONNECT From %s : %s %s", source_p->name, parv[1], parc > 2 ? parv[2] : ""); + tmpport = server_p->port; server_p->port = port; + /* * at this point we should be calling connect_server with a valid * C:line and a valid port in the C:line @@ -145,9 +147,10 @@ mo_connect(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour /* * client is either connecting with all the data it needs or has been - * destroyed + * destroyed, so reset it back to the configured settings */ server_p->port = tmpport; + return 0; }