Skip to content

Commit

Permalink
auth: replace ETIME with ETIMEDOUT (#675)
Browse files Browse the repository at this point in the history
ETIME is not available on OpenBSD and maybe other UNIX systems
  • Loading branch information
sreimers authored Feb 3, 2023
1 parent 14ad287 commit dfa56d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sip/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static int check_nonce(const struct pl *nonce, const struct sa *src,
ts = (time_t) pl_x64(&pl);

if (time(NULL) - ts > NONCE_EXPIRES)
return ETIME;
return ETIMEDOUT;

err = gen_nonce(&comp, ts, src, realm);
if (err)
Expand Down Expand Up @@ -459,7 +459,7 @@ int sip_uas_auth_check(struct sip_uas_auth *auth, const struct sip_msg *msg,
return EINVAL;

err = check_nonce(&resp.nonce, &msg->src, auth->realm);
if (err == ETIME || err == EAUTH) {
if (err == ETIMEDOUT || err == EAUTH) {
auth->stale = true;
return EAUTH;
}
Expand Down

0 comments on commit dfa56d4

Please sign in to comment.