Browse Source

- fixed bug in update_sock_struct_from_ip

Andrei Pelinescu-Onciul 23 years ago
parent
commit
ed65c5a9d2
1 changed files with 2 additions and 4 deletions
  1. 2 4
      forward.c

+ 2 - 4
forward.c

@@ -238,11 +238,9 @@ error:
 int update_sock_struct_from_ip( union sockaddr_union* to,
 	struct sip_msg *msg )
 {
-	to->sin.sin_port=(msg->via1->port)
-		?htons(msg->via1->port): htons(SIP_PORT);
-	to->sin.sin_family=msg->src_ip.af;
-	memcpy(&to->sin.sin_addr, &msg->src_ip.u, msg->src_ip.len);
 
+	init_su(to, &msg->src_ip, 
+		(msg->via1->port)?htons(msg->via1->port): htons(SIP_PORT) );
 	return 1;
 }