From 202c1d3d31d8027970e2828d2a16d81ad66a8169 Mon Sep 17 00:00:00 2001 From: Maximilian Fridrich Date: Fri, 14 Jun 2024 09:24:17 +0200 Subject: [PATCH] sipreg/reg.c: stop retrying registers early after 401/407 --- src/sipreg/reg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sipreg/reg.c b/src/sipreg/reg.c index 76e558c75..1cbb56a05 100644 --- a/src/sipreg/reg.c +++ b/src/sipreg/reg.c @@ -223,6 +223,12 @@ static void response_handler(int err, const struct sip_msg *msg, void *arg) case 401: case 407: + if (reg->ls.failc > 1 && + reg->ls.last_scode == msg->scode) { + reg->failc++; + goto out; + } + sip_auth_reset(reg->auth); err = sip_auth_authenticate(reg->auth, msg); if (err) {