Browse code

Merge 86324f26c1a7ee4e7787225761a49052f0b0a0e0 into 66fea7c615e01b200b334d5255c90911cfb360fe

sergey-safarov authored on 09/09/2020 10:43:00 • GitHub committed on 09/09/2020 10:43:00
Showing 2 changed files
... ...
@@ -491,6 +491,12 @@ int msrp_parse_uri(char *start, int len, msrp_uri_t *uri)
491 491
 	}
492 492
 	hook = &uri->host;
493 493
 	hook->s = s;
494
+	p = q_memchr(s, ']', e - s);
495
+	if(p!=NULL)
496
+	{
497
+		/* move s pointer to end of IPv6 address*/
498
+		s = p + 1;
499
+	}
494 500
 	p = q_memchr(s, ':', e - s);
495 501
 	if(p!=NULL)
496 502
 	{
... ...
@@ -283,7 +283,14 @@ int pv_get_msrp(sip_msg_t *msg,  pv_param_t *param, pv_value_t *res)
283 283
 				memcpy(p, "msrp://", 7);
284 284
 				p+=7;
285 285
 			}
286
+			if (mf->tcpinfo->rcv->src_ip.af==AF_INET6) {
287
+				strcat(p, "[");
288
+				p++;
289
+			}
286 290
 			strcpy(p, ip_addr2a(&mf->tcpinfo->rcv->src_ip));
291
+			if (mf->tcpinfo->rcv->src_ip.af==AF_INET6) {
292
+				strcat(p, "]");
293
+			}
287 294
 			strcat(p, ":");
288 295
 			strcat(p, int2str(mf->tcpinfo->rcv->src_port, NULL));
289 296
 			s.len = strlen(s.s);