Browse Source

- fixed via recieved ipv6 bug

Andrei Pelinescu-Onciul 23 years ago
parent
commit
f41ab77e15
2 changed files with 5 additions and 1 deletions
  1. 2 1
      main.c
  2. 3 0
      msg_translator.c

+ 2 - 1
main.c

@@ -854,7 +854,8 @@ int main(int argc, char** argv)
 			DPrint("ERROR: could not resolve %s\n", sock_info[r].name.s);
 			goto error;
 		}
-		hostent2ip_addr(&sock_info[r].address, he, 0); /*convert to ip_addr format*/
+		hostent2ip_addr(&sock_info[r].address, he, 0); /*convert to ip_addr 
+														 format*/
 		tmp=ip_addr2a(&sock_info[r].address);
 		sock_info[r].address_str.s=(char*)malloc(strlen(tmp)+1);
 		if (sock_info[r].address_str.s==0){

+ 3 - 0
msg_translator.c

@@ -345,6 +345,9 @@ char * build_req_buf_from_sip_req( struct sip_msg* msg,
 					/*size+=strlen(msg->via1->hdr.s+size+1)+1;*/
 					size += msg->via1->port_str.len + 1; /* +1 for ':'*/
 				}
+			#ifdef USE_IPV6
+				if(send_sock->address.af==AF_INET6) size+=1; /* +1 for ']'*/
+			#endif
 		}
 		anchor=anchor_lump(&(msg->add_rm),msg->via1->hdr.s-buf+size,0,
 				HDR_VIA);