Browse code

- fixed bug in update_sock_struct_from_ip

Andrei Pelinescu-Onciul authored on 14/10/2002 16:39:23
Showing 1 changed files
... ...
@@ -238,11 +238,9 @@ error:
238 238
 int update_sock_struct_from_ip( union sockaddr_union* to,
239 239
 	struct sip_msg *msg )
240 240
 {
241
-	to->sin.sin_port=(msg->via1->port)
242
-		?htons(msg->via1->port): htons(SIP_PORT);
243
-	to->sin.sin_family=msg->src_ip.af;
244
-	memcpy(&to->sin.sin_addr, &msg->src_ip.u, msg->src_ip.len);
245 241
 
242
+	init_su(to, &msg->src_ip, 
243
+		(msg->via1->port)?htons(msg->via1->port): htons(SIP_PORT) );
246 244
 	return 1;
247 245
 }
248 246