[Asterisk-code-review] chan sip.c: Space after port causes unnecessary resolution a... (asterisk[11])

Anonymous Coward asteriskteam at digium.com
Wed Mar 23 11:12:27 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: chan_sip.c: Space after port causes unnecessary resolution attempt
......................................................................


chan_sip.c: Space after port causes unnecessary resolution attempt

check_via() already skips leading blanks where the sent-by address (with the
optional port) should be placed.

Since RFC 3261 allows for blanks between the port ant the Via parameters:
> https://tools.ietf.org/html/rfc3261#section-20.42
(actually it allows a lot of blanks more ;-)). I just switched from
ast_skip_blanks() to ast_strip() on the local copy of the string.

ASTERISK-21301 #close

Change-Id: Ie5b8fe5a07067b7c0dc9bcdd1707e99b23b02b06
---
M channels/chan_sip.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 3eb750a..5173fc2 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -18189,7 +18189,7 @@
 	c = strchr(via, ' ');
 	if (c) {
 		*c = '\0';
-		c = ast_skip_blanks(c+1);
+		c = ast_strip(c+1);
 		if (strcasecmp(via, "SIP/2.0/UDP") && strcasecmp(via, "SIP/2.0/TCP") && strcasecmp(via, "SIP/2.0/TLS")) {
 			ast_log(LOG_WARNING, "Don't know how to respond via '%s'\n", via);
 			return;

-- 
To view, visit https://gerrit.asterisk.org/2448
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5b8fe5a07067b7c0dc9bcdd1707e99b23b02b06
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list