Commit c85d7a7e authored by Leigh Stoller's avatar Leigh Stoller

Minor cleanup regarding tcp/udp and local/remote.

parent 9b8c1198
......@@ -710,13 +710,9 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
}
}
else if (!reqp->islocal) {
if (!istcp) {
/*
* Simple "isalive" support for remote nodes.
*/
doisalive(sock, reqp, rdata, istcp, version);
goto skipit;
}
if (!istcp)
goto execute;
error("%s: Remote node connected without SSL!\n",reqp->nodeid);
if (!insecure)
goto skipit;
......@@ -726,14 +722,8 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
* When not compiled for ssl, do not allow remote connections.
*/
if (!reqp->islocal) {
if (!istcp) {
/*
* Simple "isup" daemon support!
*/
doisalive(sock, reqp, rdata, istcp, version);
goto skipit;
}
error("%s: Remote node connected without SSL!\n",reqp->nodeid);
error("%s: Remote node connection not allowed (Define SSL)!\n",
reqp->nodeid);
if (!insecure)
goto skipit;
}
......@@ -772,6 +762,7 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
/*
* Figure out what command was given.
*/
execute:
for (i = 0; i < numcommands; i++)
if (strncmp(bp, command_array[i].cmdname,
strlen(command_array[i].cmdname)) == 0)
......@@ -782,6 +773,15 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
goto skipit;
}
/*
* XXX: We allow remote nodes to use UDP for isalive only!
*/
if (!istcp && !reqp->islocal && command_array[i].func != doisalive) {
error("%s: Invalid request (%s) from remote node using UDP!\n",
reqp->nodeid, command_array[i].cmdname);
goto skipit;
}
/*
* Execute it.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment