Browse code

- fixed via recieved ipv6 bug

Andrei Pelinescu-Onciul authored on 10/07/2002 16:14:48
Showing 2 changed files
... ...
@@ -854,7 +854,8 @@ int main(int argc, char** argv)
854 854
 			DPrint("ERROR: could not resolve %s\n", sock_info[r].name.s);
855 855
 			goto error;
856 856
 		}
857
-		hostent2ip_addr(&sock_info[r].address, he, 0); /*convert to ip_addr format*/
857
+		hostent2ip_addr(&sock_info[r].address, he, 0); /*convert to ip_addr 
858
+														 format*/
858 859
 		tmp=ip_addr2a(&sock_info[r].address);
859 860
 		sock_info[r].address_str.s=(char*)malloc(strlen(tmp)+1);
860 861
 		if (sock_info[r].address_str.s==0){
... ...
@@ -345,6 +345,9 @@ char * build_req_buf_from_sip_req( struct sip_msg* msg,
345 345
 					/*size+=strlen(msg->via1->hdr.s+size+1)+1;*/
346 346
 					size += msg->via1->port_str.len + 1; /* +1 for ':'*/
347 347
 				}
348
+			#ifdef USE_IPV6
349
+				if(send_sock->address.af==AF_INET6) size+=1; /* +1 for ']'*/
350
+			#endif
348 351
 		}
349 352
 		anchor=anchor_lump(&(msg->add_rm),msg->via1->hdr.s-buf+size,0,
350 353
 				HDR_VIA);