removed synchronous DNS lockup vulnerability
This commit is contained in:
@@ -233,7 +233,7 @@ LOCAL void log_header (
|
||||
struct channel_in_use *pciu;
|
||||
char hostName[256];
|
||||
|
||||
ipAddrToA (&client->addr, hostName, sizeof(hostName));
|
||||
ipAddrToDottedIP (&client->addr, hostName, sizeof(hostName));
|
||||
|
||||
pciu = MPTOPCIU(mp);
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ void camsgtask (struct client *client)
|
||||
/*
|
||||
* disconnect when there are severe message errors
|
||||
*/
|
||||
ipAddrToA (&client->addr, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&client->addr, buf, sizeof(buf));
|
||||
epicsPrintf ("CAS: forcing disconnect from %s\n", buf);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ void cas_send_msg (struct client *pclient, int lock_needed)
|
||||
|
||||
anerrno = SOCKERRNO;
|
||||
|
||||
ipAddrToA (&pclient->addr, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&pclient->addr, buf, sizeof(buf));
|
||||
|
||||
if(pclient->proto == IPPROTO_TCP) {
|
||||
if ( (anerrno!=SOCK_ECONNABORTED&&
|
||||
|
||||
@@ -250,7 +250,7 @@ struct client *create_client (SOCKET sock)
|
||||
|
||||
if (CASDEBUG>0) {
|
||||
char buf[64];
|
||||
ipAddrToA (&client->addr, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&client->addr, buf, sizeof(buf));
|
||||
errlogPrintf ("CAS: conn req from %s\n", buf);
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ LOCAL void log_one_client (struct client *client, unsigned level)
|
||||
TS_STAMP current;
|
||||
char clientHostName[256];
|
||||
|
||||
ipAddrToA (&client->addr, clientHostName, sizeof(clientHostName));
|
||||
ipAddrToDottedIP (&client->addr, clientHostName, sizeof(clientHostName));
|
||||
|
||||
if(client->proto == IPPROTO_UDP){
|
||||
pproto = "UDP";
|
||||
|
||||
@@ -271,7 +271,7 @@ int cast_server(void)
|
||||
if (CASDEBUG>1) {
|
||||
char buf[40];
|
||||
|
||||
ipAddrToA (&prsrv_cast_client->addr, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&prsrv_cast_client->addr, buf, sizeof(buf));
|
||||
errlogPrintf ("CAS: cast server msg of %d bytes from addr %s\n",
|
||||
prsrv_cast_client->recv.cnt, buf);
|
||||
}
|
||||
@@ -286,7 +286,7 @@ int cast_server(void)
|
||||
prsrv_cast_client->recv.stk){
|
||||
char buf[40];
|
||||
|
||||
ipAddrToA (&prsrv_cast_client->addr, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&prsrv_cast_client->addr, buf, sizeof(buf));
|
||||
|
||||
epicsPrintf ("CAS: partial (damaged?) UDP msg of %d bytes from %s ?\n",
|
||||
prsrv_cast_client->recv.cnt-prsrv_cast_client->recv.stk, buf);
|
||||
@@ -295,7 +295,7 @@ int cast_server(void)
|
||||
else {
|
||||
char buf[40];
|
||||
|
||||
ipAddrToA (&prsrv_cast_client->addr, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&prsrv_cast_client->addr, buf, sizeof(buf));
|
||||
|
||||
epicsPrintf ("CAS: invalid (damaged?) UDP request from %s ?\n", buf);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ int rsrv_online_notify_task()
|
||||
|
||||
status = connect (sock, &pNode->addr.sa, sizeof(pNode->addr.sa));
|
||||
if (status<0) {
|
||||
ipAddrToA (&pNode->addr.ia, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&pNode->addr.ia, buf, sizeof(buf));
|
||||
errlogPrintf ( "%s: CA beacon routing (connect to \"%s\") error was \"%s\"\n",
|
||||
__FILE__, buf, SOCKERRSTR(SOCKERRNO));
|
||||
}
|
||||
@@ -167,7 +167,7 @@ int rsrv_online_notify_task()
|
||||
|
||||
status = send (sock, (char *)&msg, sizeof(msg), 0);
|
||||
if (status < 0) {
|
||||
ipAddrToA (&pNode->addr.ia, buf, sizeof(buf));
|
||||
ipAddrToDottedIP (&pNode->addr.ia, buf, sizeof(buf));
|
||||
errlogPrintf ( "%s: CA beacon (send to \"%s\") error was \"%s\"\n",
|
||||
__FILE__, buf, SOCKERRSTR(SOCKERRNO));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user