-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: servconf.c,v 1.419 2024/09/25 01:24:04 djm Exp $ */ | ||
/* $OpenBSD: servconf.c,v 1.421 2025/01/15 22:23:13 dtucker Exp $ */ | ||
/* | ||
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland | ||
* All rights reserved | ||
|
@@ -2808,23 +2808,25 @@ parse_server_match_config(ServerOptions *options, | |
copy_set_server_options(options, &mo, 0); | ||
} | ||
|
||
int parse_server_match_testspec(struct connection_info *ci, char *spec) | ||
int | ||
parse_server_match_testspec(struct connection_info *ci, char *spec) | ||
{ | ||
char *p; | ||
const char *val; | ||
|
||
while ((p = strsep(&spec, ",")) && *p != '\0') { | ||
if (strncmp(p, "addr=", 5) == 0) { | ||
ci->address = xstrdup(p + 5); | ||
} else if (strncmp(p, "host=", 5) == 0) { | ||
ci->host = xstrdup(p + 5); | ||
} else if (strncmp(p, "user=", 5) == 0) { | ||
ci->user = xstrdup(p + 5); | ||
} else if (strncmp(p, "laddr=", 6) == 0) { | ||
ci->laddress = xstrdup(p + 6); | ||
} else if (strncmp(p, "rdomain=", 8) == 0) { | ||
ci->rdomain = xstrdup(p + 8); | ||
} else if (strncmp(p, "lport=", 6) == 0) { | ||
ci->lport = a2port(p + 6); | ||
if ((val = strprefix(p, "addr=", 0)) != NULL) { | ||
ci->address = xstrdup(val); | ||
} else if ((val = strprefix(p, "host=", 0)) != NULL) { | ||
ci->host = xstrdup(val); | ||
} else if ((val = strprefix(p, "user=", 0)) != NULL) { | ||
ci->user = xstrdup(val); | ||
} else if ((val = strprefix(p, "laddr=", 0)) != NULL) { | ||
ci->laddress = xstrdup(val); | ||
} else if ((val = strprefix(p, "rdomain=", 0)) != NULL) { | ||
ci->rdomain = xstrdup(val); | ||
} else if ((val = strprefix(p, "lport=", 0)) != NULL) { | ||
ci->lport = a2port(val); | ||
if (ci->lport == -1) { | ||
fprintf(stderr, "Invalid port '%s' in test mode" | ||
" specification %s\n", p+6, p); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters