- bugfix : wrong sizeof in sendto
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 6 Sep 2001 04:10:28 +0000 (04:10 +0000)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 6 Sep 2001 04:10:28 +0000 (04:10 +0000)
forward.c
udp_server.c

index 036ba33..0e958d3 100644 (file)
--- a/forward.c
+++ b/forward.c
@@ -227,7 +227,7 @@ int forward_reply(char * orig, char* buf,
        to->sin_port = (msg->via2.port)?htons(msg->via2.port):htons(SIP_PORT);
        to->sin_addr.s_addr=*((long*)he->h_addr_list[0]);
        
-       if (udp_send(new_buf,new_len, &to, sizeof(to))==-1)
+       if (udp_send(new_buf,new_len, &to, sizeof(struct sockaddr))==-1)
                goto error;
        
        free(new_buf);
index 6532225..6547195 100644 (file)
@@ -74,7 +74,7 @@ int udp_rcv_loop()
        }
 
        for(;;){
-               fromlen=sizeof(*from);
+               fromlen=sizeof(struct sockaddr);
                len=recvfrom(udp_sock, buf, BUF_SIZE, 0, from, &fromlen);
                if (len==-1){
                        DPrint("ERROR: udp_rcv_loop:recvfrom: %s\n", strerror());