rsrv: ignore echo and unexpected UDP

Ignore UDP echo.
By default, don't log unexpected/invalid
UDP messages.
This commit is contained in:
Michael Davidsaver
2016-07-30 10:41:39 -04:00
parent 813166128e
commit 16c419350b
2 changed files with 5 additions and 24 deletions

View File

@@ -324,31 +324,12 @@ unsigned lineno
static int bad_udp_cmd_action ( caHdrLargeArray *mp,
void *pPayload, struct client *pClient )
{
log_header ("invalid (damaged?) request code from UDP",
pClient, mp, pPayload, 0);
if (CASDEBUG > 0)
log_header ("invalid (damaged?) request code from UDP",
pClient, mp, pPayload, 0);
return RSRV_ERROR;
}
/*
* udp_echo_action()
*/
static int udp_echo_action ( caHdrLargeArray *mp,
void *pPayload, struct client *pClient )
{
char *pPayloadOut;
int status;
SEND_LOCK ( pClient );
status = cas_copy_in_header ( pClient, mp->m_cmmd, mp->m_postsize,
mp->m_dataType, mp->m_count, mp->m_cid, mp->m_available,
( void * ) &pPayloadOut );
if ( status == ECA_NORMAL ) {
memcpy ( pPayloadOut, pPayload, mp->m_postsize );
cas_commit_msg ( pClient, mp->m_postsize );
}
SEND_UNLOCK ( pClient );
return RSRV_OK;
}
/*
* bad_tcp_cmd_action()
*/
@@ -2488,7 +2469,7 @@ static const pProtoStubUDP udpJumpTable[] =
bad_udp_cmd_action,
bad_udp_cmd_action,
bad_udp_cmd_action,
udp_echo_action,
bad_udp_cmd_action,
bad_udp_cmd_action,
bad_udp_cmd_action,
bad_udp_cmd_action,

View File

@@ -247,7 +247,7 @@ void cast_server(void *pParm)
epicsPrintf ("CAS: message received at %s\n", buf);
}
}
else {
else if (CASDEBUG>0){
char buf[40];
ipAddrToDottedIP (&client->addr, buf, sizeof(buf));