summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-24 14:04:32 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-24 14:04:32 +0000
commit310e0b9c1fa4a9ba9cb2a461170bc5127b9331ea (patch)
tree17800a8dd842fe72d53c0e6b0c111a3cad375075 /src
parentfixed bug @ file log target (diff)
fixed addrlen bug @ getaddrinfo
Diffstat (limited to 'src')
-rw-r--r--src/udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udp.c b/src/udp.c
index 23d97af..bab9c42 100644
--- a/src/udp.c
+++ b/src/udp.c
@@ -76,7 +76,7 @@ int udp_init(udp_socket_t* sock, const char* local_addr, const char* port)
return -1;
}
- memcpy(&(sock->local_end_), res->ai_addr, sizeof(*(res->ai_addr)));
+ memcpy(&(sock->local_end_), res->ai_addr, res->ai_addrlen);
sock->fd_ = socket(res->ai_family, SOCK_DGRAM, 0);
if(sock->fd_ < 0) {
@@ -120,7 +120,7 @@ void udp_set_remote(udp_socket_t* sock, const char* remote_addr, const char* por
log_printf(ERROR, "Error resolving remote address: %s", gai_strerror(errcode));
return;
}
- memcpy(&(sock->remote_end_), res->ai_addr, sizeof(*(res->ai_addr)));
+ memcpy(&(sock->remote_end_), res->ai_addr, res->ai_addrlen);
sock->remote_end_set_ = 1;
freeaddrinfo(res);
}