Browse code

- bugfix : wrong sizeof in sendto

Andrei Pelinescu-Onciul authored on 06/09/2001 04:10:28
Showing 2 changed files
... ...
@@ -227,7 +227,7 @@ int forward_reply(char * orig, char* buf,
227 227
 	to->sin_port = (msg->via2.port)?htons(msg->via2.port):htons(SIP_PORT);
228 228
 	to->sin_addr.s_addr=*((long*)he->h_addr_list[0]);
229 229
 	
230
-	if (udp_send(new_buf,new_len, &to, sizeof(to))==-1)
230
+	if (udp_send(new_buf,new_len, &to, sizeof(struct sockaddr))==-1)
231 231
 		goto error;
232 232
 	
233 233
 	free(new_buf);
... ...
@@ -74,7 +74,7 @@ int udp_rcv_loop()
74 74
 	}
75 75
 
76 76
 	for(;;){
77
-		fromlen=sizeof(*from);
77
+		fromlen=sizeof(struct sockaddr);
78 78
 		len=recvfrom(udp_sock, buf, BUF_SIZE, 0, from, &fromlen);
79 79
 		if (len==-1){
80 80
 			DPrint("ERROR: udp_rcv_loop:recvfrom: %s\n", strerror());