diff --git a/src/ca/legacy/pcas/generic/casDGClient.cc b/src/ca/legacy/pcas/generic/casDGClient.cc index ffcfa69ff..0760c2e24 100644 --- a/src/ca/legacy/pcas/generic/casDGClient.cc +++ b/src/ca/legacy/pcas/generic/casDGClient.cc @@ -131,6 +131,16 @@ caStatus casDGClient::searchAction() const char *pChanName = static_cast ( this->ctx.getData() ); caStatus status; + if (!CA_VSUPPORTED(mp->m_count)) { + if ( this->getCAS().getDebugLevel() > 3u ) { + char pHostName[64u]; + this->hostName ( pHostName, sizeof ( pHostName ) ); + printf ( "\"%s\" is searching for \"%s\" but is too old\n", + pHostName, pChanName ); + } + return S_cas_badProtocol; + } + // // check the sanity of the message // @@ -368,6 +378,15 @@ caStatus casDGClient::versionAction () { const caHdrLargeArray * mp = this->ctx.getMsg(); + if (!CA_VSUPPORTED(mp->m_count)) { + if ( this->getCAS().getDebugLevel() > 3u ) { + char pHostName[64u]; + this->hostName ( pHostName, sizeof ( pHostName ) ); + printf ( "\"%s\" is too old\n", + pHostName ); + } + return S_cas_badProtocol; + } if ( mp->m_count != 0 ) { this->minor_version_number = static_cast ( mp->m_count ); if ( CA_V411 ( mp->m_count ) ) { diff --git a/src/ca/legacy/pcas/generic/casStrmClient.cc b/src/ca/legacy/pcas/generic/casStrmClient.cc index 015192769..eed6543a5 100644 --- a/src/ca/legacy/pcas/generic/casStrmClient.cc +++ b/src/ca/legacy/pcas/generic/casStrmClient.cc @@ -338,6 +338,16 @@ caStatus casStrmClient::versionAction ( epicsGuard < casClientMutex > & ) return S_cas_badProtocol; } + if (!CA_VSUPPORTED(mp->m_count)) { + if ( this->getCAS().getDebugLevel() > 3u ) { + char pHostName[64u]; + this->hostName ( pHostName, sizeof ( pHostName ) ); + printf ( "\"%s\" is too old\n", + pHostName ); + } + return S_cas_badProtocol; + } + double tmp = mp->m_dataType - CA_PROTO_PRIORITY_MIN; tmp *= epicsThreadPriorityCAServerHigh - epicsThreadPriorityCAServerLow; tmp /= CA_PROTO_PRIORITY_MAX - CA_PROTO_PRIORITY_MIN; @@ -1322,6 +1332,16 @@ caStatus casStrmClient :: searchAction ( epicsGuard < casClientMutex > & guard ) const char *pChanName = static_cast ( this->ctx.getData() ); caStatus status; + if (!CA_VSUPPORTED(mp->m_count)) { + if ( this->getCAS().getDebugLevel() > 3u ) { + char pHostName[64u]; + this->hostName ( pHostName, sizeof ( pHostName ) ); + printf ( "\"%s\" is searching for \"%s\" but is too old\n", + pHostName, pChanName ); + } + return S_cas_badProtocol; + } + // // check the sanity of the message //