Skip to content

Commit

Permalink
[core] Fixed srt_getopt(...): set optlen.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko authored and rndi committed Nov 4, 2019
1 parent b9a4d1f commit 5f79089
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions srtcore/core.cpp
Expand Up @@ -1080,13 +1080,15 @@ void CUDT::getOpt(SRT_SOCKOPT optName, void *optval, int &optlen)
*(int32_t *)optval = m_pSndQueue->getIpTTL();
else
*(int32_t *)optval = m_iIpTTL;
optlen = sizeof(int32_t);
break;

case SRTO_IPTOS:
if (m_bOpened)
*(int32_t *)optval = m_pSndQueue->getIpToS();
else
*(int32_t *)optval = m_iIpToS;
optlen = sizeof(int32_t);
break;
#endif

Expand Down Expand Up @@ -1136,6 +1138,7 @@ void CUDT::getOpt(SRT_SOCKOPT optName, void *optval, int &optlen)
*(int32_t *)optval = m_pCryptoControl->m_SndKmState;
else
*(int32_t *)optval = m_pCryptoControl->m_RcvKmState;
optlen = sizeof(int32_t);
break;

case SRTO_SNDKMSTATE: // State imposed by Agent depending on PW and KMX
Expand Down

0 comments on commit 5f79089

Please sign in to comment.