Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
c85d7a7e
Commit
c85d7a7e
authored
Jan 30, 2003
by
Leigh B. Stoller
Browse files
Minor cleanup regarding tcp/udp and local/remote.
parent
9b8c1198
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/tmcd.c
View file @
c85d7a7e
...
...
@@ -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.
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment