Skip to content

Commit

Permalink
Allow ACK w/o Max-Forwards header
Browse files Browse the repository at this point in the history
  • Loading branch information
juha-h committed May 19, 2024
1 parent 0b99538 commit ee41089
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/sip/transp.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static bool have_essential_fields(const struct sip_msg *msg)
pl_isset(&(msg->from.auri)) &&
pl_isset(&(msg->cseq.met)) &&
pl_isset(&(msg->callid)) &&
pl_isset(&(msg->maxfwd)) &&
(pl_isset(&(msg->maxfwd)) || !pl_strcmp(&msg->met, "ACK")) &&
pl_isset(&(msg->via.branch)))
return true;

Expand All @@ -333,12 +333,8 @@ static void sip_recv(struct sip *sip, const struct sip_msg *msg,
}

if (msg->req) {
if (!have_essential_fields(msg)) {
if (!pl_strcmp(&msg->met, "ACK"))
DEBUG_NOTICE("received bad ACK request "
"from %r\n", &(msg->from.auri));
else
(void)sip_reply(sip, msg, 400, "Bad Request");
if (!have_essential_fields(msg)){
(void)sip_reply(sip, msg, 400, "Bad Request");
return;
}
}
Expand Down

0 comments on commit ee41089

Please sign in to comment.