[Live-devel] SETUP request with "Transport: RTP/AVP; multicast" breaks RTSP proxy

Juho Ylikorpi juho.ylikorpi at node.solutions
Thu Feb 28 23:08:34 PST 2019


Hi,

We found out that,

    Request: SETUP rtsp://...:554/proxyStream/track1 RTSP/1.0\r\n
    CSeq: 17410\r\n
    Transport: RTP/AVP;multicast
    User-Agent: RTSP Agent\r\n
    \r\n

...halts all parallel RTP streams from same proxy server (and when client repeatedly tries to reconnect paralyzes streaming completely). It seems that RTSPServer.cpp doesn't validate clientRTPPortNum on client setup and patch below prevents the problem. I guess that there should be implemented better parameter validation?

--- a/liveMedia/RTSPServer.cpp
+++ b/liveMedia/RTSPServer.cpp
@@ -299,7 +299,7 @@ void RTSPServer::RTSPClientConnection
@@ -112,39 +112,7 @@ index 1c33dd7..60ea00c 100644
  }

  void RTSPServer::RTSPClientConnection
-@@ -1456,16 +1456,21 @@ void RTSPServer::RTSPClientSession
-     } else {
-       switch (streamingMode) {
-           case RTP_UDP: {
--          snprintf((char*)ourClientConnection->fResponseBuffer, sizeof ourClientConnection->fResponseBuffer,
--                   "RTSP/1.0 200 OK\r\n"
--                   "CSeq: %s\r\n"
--                   "%s"
--                   "Transport: RTP/AVP;unicast;destination=%s;source=%s;client_port=%d-%d;server_port=%d-%d\r\n"
--                   "Session: %08X%s\r\n\r\n",
--                   ourClientConnection->fCurrentCSeq,
--                   dateHeader(),
--                   destAddrStr.val(), sourceAddrStr.val(), ntohs(clientRTPPort.num()), ntohs(clientRTCPPort.num()), ntohs(serverRTPPort.num()), ntohs(serverRTCPPort.num()),
--                   fOurSessionId, timeoutParameterString);
-+            if (clientRTPPortNum != 0) {
-+                snprintf((char*)ourClientConnection->fResponseBuffer, sizeof ourClientConnection->fResponseBuffer,
-+                         "RTSP/1.0 200 OK\r\n"
-+                         "CSeq: %s\r\n"
-+                         "%s"
-+                         "Transport: RTP/AVP;unicast;destination=%s;source=%s;client_port=%d-%d;server_port=%d-%d\r\n"
-+                         "Session: %08X%s\r\n\r\n",
-+                         ourClientConnection->fCurrentCSeq,
-+                         dateHeader(),
-+                         destAddrStr.val(), sourceAddrStr.val(), ntohs(clientRTPPort.num()), ntohs(clientRTCPPort.num()), ntohs(serverRTPPort.num()), ntohs(serverRTCPPort.num()),
-+                         fOurSessionId, timeoutParameterString);
-+            } else {
-+                // client port needs to be defined
-+                ourClientConnection->handleCmd_unsupportedTransport();
-+            }
-           break;
-         }
-           case RTP_TCP: {
-@@ -1582,7 +1587,7 @@ void RTSPServer::RTSPClientSession

--
Best regards,
Juho Ylikorpi
Node Solutions Ltd
Itäinen Pitkäkatu 4 C (PharmaCity)
FI-20520 TURKU
FINLAND

Tel. +358 2 4802 8550
Mob. +358 40 544 7406
http://node.solutions/
juho.ylikorpi at node.solutions<mailto:juho.ylikorpi at node.solutions>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20190301/3fad2bbc/attachment.html>


More information about the live-devel mailing list