+35
-10
lines changedFilter options
+35
-10
lines changed Original file line number Diff line number Diff line change
@@ -2400,7 +2400,17 @@ bool CUDT::interpretSrtHandshake(const CHandShake& hs,
2400
2400
}
2401
2401
2402
2402
if (hs.m_iVersion < HS_VERSION_SRT1)
2403
+
{
2404
+
if (m_config.uMinimumPeerSrtVersion && m_config.uMinimumPeerSrtVersion >= SRT_VERSION_FEAT_HSv5)
2405
+
{
2406
+
m_RejectReason = SRT_REJ_VERSION;
2407
+
// This means that a version with minimum 1.3.0 that features HSv5 is required,
2408
+
// hence all HSv4 clients should be rejected.
2409
+
LOGP(cnlog.Error, "interpretSrtHandshake: minimum peer version 1.3.0 (HSv5 only), rejecting HSv4 client");
2410
+
return false;
2411
+
}
2403
2412
return true; // do nothing
2413
+
}
2404
2414
2405
2415
// Anyway, check if the handshake contains any extra data.
2406
2416
if (hspkt.getLength() <= CHandShake::m_iContentSize)
@@ -10618,16 +10628,31 @@ int CUDT::processConnectRequest(const sockaddr_any& addr, CPacket& packet)
10618
10628
// (or the above procedure failed)
10619
10629
if (result == -1)
10620
10630
{
10621
-
HLOGC(cnlog.Debug,
10622
-
log << CONID() << "processConnectRequest: sending ABNORMAL handshake info req="
10623
-
<< RequestTypeStr(hs.m_iReqType));
10624
-
size_t size = CHandShake::m_iContentSize;
10625
-
hs.store_to((packet.m_pcData), (size));
10626
-
packet.setLength(size);
10627
-
packet.m_iID = id;
10628
-
setPacketTS(packet, steady_clock::now());
10629
-
HLOGC(cnlog.Debug, log << "processConnectRequest: SENDING HS (a): " << hs.show());
10630
-
m_pSndQueue->sendto(addr, packet);
10631
+
if (hs.m_iVersion < HS_VERSION_SRT1)
10632
+
{
10633
+
HLOGC(cnlog.Debug, log << CONID() << "processConnectRequest: HSv4 caller, sending SHUTDOWN after rejection with "
10634
+
<< RequestTypeStr(hs.m_iReqType));
10635
+
// The HSv4 clients do not interpret the error handshake response correctly.
10636
+
// In order to really disallow them to connect there's needed the shutdown response.
10637
+
CPacket rsp;
10638
+
setPacketTS((rsp), steady_clock::now());
10639
+
rsp.pack(UMSG_SHUTDOWN);
10640
+
rsp.m_iID = m_PeerID;
10641
+
m_pSndQueue->sendto(addr, rsp);
10642
+
}
10643
+
else
10644
+
{
10645
+
HLOGC(cnlog.Debug,
10646
+
log << CONID() << "processConnectRequest: sending ABNORMAL handshake info req="
10647
+
<< RequestTypeStr(hs.m_iReqType));
10648
+
size_t size = CHandShake::m_iContentSize;
10649
+
hs.store_to((packet.m_pcData), (size));
10650
+
packet.setLength(size);
10651
+
packet.m_iID = id;
10652
+
setPacketTS(packet, steady_clock::now());
10653
+
HLOGC(cnlog.Debug, log << "processConnectRequest: SENDING HS (a): " << hs.show());
10654
+
m_pSndQueue->sendto(addr, packet);
10655
+
}
10631
10656
}
10632
10657
// new connection response should be sent in acceptAndRespond()
10633
10658
// turn the socket writable if this is the first time when this was found out.
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4