1
0
mirror of https://github.com/open-simh/simh.git synced 2026-05-05 15:43:58 +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

@@ -791,8 +791,7 @@ for (i = 0; i < mp->lines; i++) { /* check each line in se
if (lp->destination) { /* Virtual Null Modem Cable? */
char host[CBUFSIZE];
sim_parse_addr (lp->destination, host, sizeof(host), NULL, NULL, 0, NULL);
if (strcmp(address, host)) {
if (sim_parse_addr (lp->destination, host, sizeof(host), NULL, NULL, 0, NULL, address)) {
tmxr_msg (newsock, "Rejecting connection from unexpected source\r\n");
sprintf (msg, "tmxr_poll_conn() - Rejecting line connection from: %s, Expected: %s", address, host);
tmxr_debug_trace_line (lp, msg);
@@ -1459,7 +1458,7 @@ while (*tptr) {
continue;
}
cptr = get_glyph (gbuf, port, ';');
if (SCPE_OK != sim_parse_addr (port, NULL, 0, NULL, NULL, 0, NULL))
if (SCPE_OK != sim_parse_addr (port, NULL, 0, NULL, NULL, 0, NULL, NULL))
return SCPE_ARG;
if (cptr)
get_glyph (cptr, cptr, 0); /* upcase this string */