1
0
mirror of https://github.com/open-simh/simh.git synced 2026-04-25 20:01:33 +00:00

Added an optional validation argument to sim_parse_addr for callers which need to confirm incoming connections come from expected sources

This commit is contained in:
Mark Pizzolato
2012-12-09 12:12:09 -08:00
parent 822fedf8ce
commit 7f6a1af5bf
8 changed files with 135 additions and 104 deletions

View File

@@ -462,7 +462,7 @@ static t_stat sca_attach (UNIT *uptr, char *cptr)
detach_unit(&sca_unit);
if (do_listen) { /* if listen mode, string specifies port number (only; otherwise it's a dummy argument) */
r = sim_parse_addr (cptr, host, sizeof(host), NULL, port, sizeof(port), SCA_DEFAULT_PORT);
r = sim_parse_addr (cptr, host, sizeof(host), NULL, port, sizeof(port), SCA_DEFAULT_PORT, NULL);
if (r != SCPE_OK)
return r;
if ((0 == strcmp(port, cptr)) && (0 == strcmp(port, "dummy")))
@@ -493,7 +493,7 @@ static t_stat sca_attach (UNIT *uptr, char *cptr)
if (! *cptr)
return SCPE_2FARG;
r = sim_parse_addr (cptr, host, sizeof(host), NULL, port, sizeof(port), SCA_DEFAULT_PORT);
r = sim_parse_addr (cptr, host, sizeof(host), NULL, port, sizeof(port), SCA_DEFAULT_PORT, NULL);
if (r != SCPE_OK)
return r;
if ((0 == strcmp(cptr, port)) && (0 == strcmp(host, ""))) {