[asterisk-commits] lmadsen: tag 1.8.4.1 r319996 - in /tags/1.8.4.1: ./ channels/ channels/sip/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 20 10:47:53 CDT 2011


Author: lmadsen
Date: Fri May 20 10:47:46 2011
New Revision: 319996

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=319996
Log:
Update .version, ChangeLog files. Remove old summary files.
Merge changes from issue #18951.

Removed:
    tags/1.8.4.1/asterisk-1.8.4-summary.html
    tags/1.8.4.1/asterisk-1.8.4-summary.txt
Modified:
    tags/1.8.4.1/.version
    tags/1.8.4.1/ChangeLog
    tags/1.8.4.1/channels/chan_sip.c
    tags/1.8.4.1/channels/sip/reqresp_parser.c

Modified: tags/1.8.4.1/.version
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.1/.version?view=diff&rev=319996&r1=319995&r2=319996
==============================================================================
--- tags/1.8.4.1/.version (original)
+++ tags/1.8.4.1/.version Fri May 20 10:47:46 2011
@@ -1,1 +1,1 @@
-1.8.4
+1.8.4.1

Modified: tags/1.8.4.1/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.1/ChangeLog?view=diff&rev=319996&r1=319995&r2=319996
==============================================================================
--- tags/1.8.4.1/ChangeLog (original)
+++ tags/1.8.4.1/ChangeLog Fri May 20 10:47:46 2011
@@ -1,3 +1,32 @@
+2011-05-20  Leif Madsen <lmadsen at digium.com>
+
+	* Asterisk 1.8.4.1 Released.
+
+	r315891 | mnicholson | 2011-04-27 13:57:56 -0500 (Wed, 27 Apr 2011) | 14 lines
+
+	Fix our compliance with RFC 3261 section 18.2.2.
+	This change optimizes the free_via() function and removes some redundant
+	null checking. It also fixes compliance with RFC 3261 section 18.2.2 by
+	always using the port specified in the Via header for routing responses
+	(even when maddr is not set). Also the htons() function is now used
+	when setting the port.	Additional documentation comments have been
+	added in various places to make the logic in the code clearer.
+		(closes issue 0018951)
+		Reported by: jmls
+		Patches:
+			issue18951_set_proper_port_from_via.patch uploaded by 
+			wdoekes (license 717) (modified)
+
+	r318720 | mnicholson | 2011-05-12 18:35:51 -0500 (Thu, 12 May 2011) |
+	6 lines
+
+	Handle ipv6 addresses in the sent-by Via: field.
+
+	This change fixes a regression in via header parsing and ipv6
+	handling.
+
+	(closes issue 0018951)
+
 2011-05-09  Leif Madsen <lmadsen at digium.com>
 
 	* Asteris 1.8.4 Released.

Modified: tags/1.8.4.1/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.1/channels/chan_sip.c?view=diff&rev=319996&r1=319995&r2=319996
==============================================================================
--- tags/1.8.4.1/channels/chan_sip.c (original)
+++ tags/1.8.4.1/channels/chan_sip.c Fri May 20 10:47:46 2011
@@ -7373,6 +7373,21 @@
 	return ((ast_sockaddr_ipv4(addr) & 0xf0000000) == 0xe0000000);
 }
 
+/*!
+ * \brief Process the Via header according to RFC 3261 section 18.2.2.
+ * \param p a sip_pvt structure that will be modified according to the received
+ * header
+ * \param req a sip request with a Via header to process
+ *
+ * This function will update the destination of the response according to the
+ * Via header in the request and RFC 3261 section 18.2.2. We do not have a
+ * transport layer so we ignore certain values like the 'received' param (we
+ * set the destination address to the addres the request came from in the
+ * respprep() function).
+ *
+ * \retval -1 error
+ * \retval 0 success
+ */
 static int process_via(struct sip_pvt *p, const struct sip_request *req)
 {
 	struct sip_via *via = parse_via(get_header(req, "Via"));
@@ -7390,16 +7405,12 @@
 			return -1;
 		}
 
-		if (via->port) {
-			ast_sockaddr_set_port(&p->sa, via->port);
-		} else {
-			ast_sockaddr_set_port(&p->sa, STANDARD_SIP_PORT);
-		}
-
 		if (addr_is_multicast(&p->sa)) {
 			setsockopt(sipsock, IPPROTO_IP, IP_MULTICAST_TTL, &via->ttl, sizeof(via->ttl));
 		}
 	}
+
+	ast_sockaddr_set_port(&p->sa, via->port ? via->port : STANDARD_SIP_PORT);
 
 	free_via(via);
 	return 0;
@@ -9736,6 +9747,9 @@
 
 	/* default to routing the response to the address where the request
 	 * came from.  Since we don't have a transport layer, we do this here.
+	 * The process_via() function will update the port to either the port
+	 * specified in the via header or the default port later on (per RFC
+	 * 3261 section 18.2.2).
 	 */
 	p->sa = p->recv;
 

Modified: tags/1.8.4.1/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.4.1/channels/sip/reqresp_parser.c?view=diff&rev=319996&r1=319995&r2=319996
==============================================================================
--- tags/1.8.4.1/channels/sip/reqresp_parser.c (original)
+++ tags/1.8.4.1/channels/sip/reqresp_parser.c Fri May 20 10:47:46 2011
@@ -2249,10 +2249,7 @@
 		return;
 	}
 
-	if (v->via) {
-		ast_free(v->via);
-	}
-
+	ast_free(v->via);
 	ast_free(v);
 }
 
@@ -2301,8 +2298,9 @@
 	}
 	v->sent_by = ast_skip_blanks(v->sent_by);
 
-	/* store the port */
-	if ((parm = strchr(v->sent_by, ':'))) {
+	/* store the port, we have to handle ipv6 addresses containing ':'
+	 * characters gracefully */
+	if (((parm = strchr(v->sent_by, ']')) && *(++parm) == ':') || (parm = strchr(v->sent_by, ':'))) {
 		char *endptr;
 
 		v->port = strtol(++parm, &endptr, 10);
@@ -2388,6 +2386,13 @@
 		.expected_maddr = "224.0.0.1",
 		.expected_ttl = 1,
 	};
+	struct testdata t7 = {
+		.in = "SIP/2.0/UDP [::1]:5060",
+		.expected_protocol = "SIP/2.0/UDP",
+		.expected_sent_by = "[::1]:5060",
+		.expected_port = 5060,
+		.expected_branch = "",
+	};
 	switch (cmd) {
 	case TEST_INIT:
 		info->name = "parse_via_test";
@@ -2407,6 +2412,7 @@
 	AST_LIST_INSERT_TAIL(&testdatalist, &t4, list);
 	AST_LIST_INSERT_TAIL(&testdatalist, &t5, list);
 	AST_LIST_INSERT_TAIL(&testdatalist, &t6, list);
+	AST_LIST_INSERT_TAIL(&testdatalist, &t7, list);
 
 
 	AST_LIST_TRAVERSE(&testdatalist, testdataptr, list) {




More information about the asterisk-commits mailing list