Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sock_resolve_required #356

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use more complicated form of sock_resolve_required()
  • Loading branch information
gperciva committed May 13, 2022
commit ec2cef1bc479a6eed5334e9c69e9e63d5fb746d9
26 changes: 4 additions & 22 deletions spiped/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,30 +275,12 @@ main(int argc, char * argv[])
}

/* Resolve source address. */
while ((sas_s = sock_resolve(opt_s)) == NULL) {
if (!opt_D) {
warnp("Error resolving socket address: %s", opt_s);
goto err1;
}
sleep(1);
}
if (sas_s[0] == NULL) {
warn0("No addresses found for %s", opt_s);
goto err2;
}
if ((sas_s = sock_resolve_required(opt_s, 1, opt_D)) == NULL)
goto err1;

/* Resolve target address. */
while ((sas_t = sock_resolve(opt_t)) == NULL) {
if (!opt_D) {
warnp("Error resolving socket address: %s", opt_t);
goto err2;
}
sleep(1);
}
if (sas_t[0] == NULL) {
warn0("No addresses found for %s", opt_t);
goto err3;
}
if ((sas_t = sock_resolve_required(opt_t, 1, opt_D)) == NULL)
goto err2;

/* Load the keying data. */
if ((K = proto_crypt_secret(opt_k)) == NULL) {
Expand Down