summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_spanningtree/handshaketimer.cpp2
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp8
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp3
3 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp
index a82ea7ea0..652390750 100644
--- a/src/modules/m_spanningtree/handshaketimer.cpp
+++ b/src/modules/m_spanningtree/handshaketimer.cpp
@@ -53,7 +53,7 @@ void HandshakeTimer::Tick(time_t TIME)
{
InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
sock->SendCapabilities();
- if (sock->GetLinkState() == CONNECTING)
+ if ((sock->GetLinkState() == CONNECTING) && (sock->GetOurChallenge().empty()))
sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass, sock->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
}
else
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index b0a7e3205..2ce296001 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -173,8 +173,6 @@ bool TreeSocket::OnConnected()
InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
this->Instance->SNO->WriteToSnoMask('l',"Connection to \2"+myhost+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+x->Hook+"\2");
}
- else
- this->SendCapabilities();
/* found who we're supposed to be connecting to, send the neccessary gubbins. */
Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(*x), this->Utils));
return true;
@@ -414,6 +412,12 @@ bool TreeSocket::Capab(const std::deque<std::string> &params)
{
/* Challenge-response is on now */
this->SetTheirChallenge(n->second);
+ if (!this->GetOurChallenge().empty() && (this->LinkState == CONNECTING))
+ {
+ Link* lnk = Utils->FindLink(this->myhost.c_str());
+ if (lnk)
+ this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(lnk->SendPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
+ }
}
if (reason.length())
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 1aa4fc8c7..8c332dc63 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -902,7 +902,8 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> &params)
this->InboundDescription = description;
// this is good. Send our details: Our server name and description and hopcount of 0,
// along with the sendpass from this block.
- this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
+ if (this->GetOurChallenge().empty())
+ this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
// move to the next state, we are now waiting for THEM.
this->LinkState = WAIT_AUTH_2;
return true;