diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-05-25 21:41:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-05-25 21:41:52 +0000 |
commit | 0d43d44a39a7cee4bc1a84ab5eb36ac8eb05e2a2 (patch) | |
tree | 7a274ea3d3591fe59d724ca691fdc976d0175066 /src/util/gnunet-service-resolver.c | |
parent | 79ae099456caba64b0599b7c6e2b2b86bcc6571f (diff) | |
download | gnunet-0d43d44a39a7cee4bc1a84ab5eb36ac8eb05e2a2.tar.gz gnunet-0d43d44a39a7cee4bc1a84ab5eb36ac8eb05e2a2.zip |
set sxn_len on FreeBSD where required
Diffstat (limited to 'src/util/gnunet-service-resolver.c')
-rw-r--r-- | src/util/gnunet-service-resolver.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index f72b70da7..ee2cfb3b8 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c | |||
@@ -327,6 +327,9 @@ gethostbyname2_resolve (struct GNUNET_SERVER_TransmitContext *tc, | |||
327 | GNUNET_assert (hp->h_length == sizeof (struct in_addr)); | 327 | GNUNET_assert (hp->h_length == sizeof (struct in_addr)); |
328 | memset (&a4, 0, sizeof (a4)); | 328 | memset (&a4, 0, sizeof (a4)); |
329 | a4.sin_family = AF_INET; | 329 | a4.sin_family = AF_INET; |
330 | #if HAVE_SOCKADDR_IN_SIN_LEN | ||
331 | a4.sin_len = (u_char) sizeof (struct sockaddr_in); | ||
332 | #endif | ||
330 | memcpy (&a4.sin_addr, hp->h_addr_list[0], hp->h_length); | 333 | memcpy (&a4.sin_addr, hp->h_addr_list[0], hp->h_length); |
331 | GNUNET_SERVER_transmit_context_append_data (tc, | 334 | GNUNET_SERVER_transmit_context_append_data (tc, |
332 | &a4, | 335 | &a4, |
@@ -338,6 +341,9 @@ gethostbyname2_resolve (struct GNUNET_SERVER_TransmitContext *tc, | |||
338 | GNUNET_assert (hp->h_length == sizeof (struct in6_addr)); | 341 | GNUNET_assert (hp->h_length == sizeof (struct in6_addr)); |
339 | memset (&a6, 0, sizeof (a6)); | 342 | memset (&a6, 0, sizeof (a6)); |
340 | a6.sin6_family = AF_INET6; | 343 | a6.sin6_family = AF_INET6; |
344 | #if HAVE_SOCKADDR_IN_SIN_LEN | ||
345 | a6.sin6_len = (u_char) sizeof (struct sockaddr_in6); | ||
346 | #endif | ||
341 | memcpy (&a6.sin6_addr, hp->h_addr_list[0], hp->h_length); | 347 | memcpy (&a6.sin6_addr, hp->h_addr_list[0], hp->h_length); |
342 | GNUNET_SERVER_transmit_context_append_data (tc, | 348 | GNUNET_SERVER_transmit_context_append_data (tc, |
343 | &a6, | 349 | &a6, |
@@ -372,6 +378,9 @@ gethostbyname_resolve (struct GNUNET_SERVER_TransmitContext *tc, | |||
372 | GNUNET_assert (hp->h_length == sizeof (struct in_addr)); | 378 | GNUNET_assert (hp->h_length == sizeof (struct in_addr)); |
373 | memset (&addr, 0, sizeof (addr)); | 379 | memset (&addr, 0, sizeof (addr)); |
374 | addr.sin_family = AF_INET; | 380 | addr.sin_family = AF_INET; |
381 | #if HAVE_SOCKADDR_IN_SIN_LEN | ||
382 | addr.sin_len = (u_char) sizeof (struct sockaddr_in); | ||
383 | #endif | ||
375 | memcpy (&addr.sin_addr, hp->h_addr_list[0], hp->h_length); | 384 | memcpy (&addr.sin_addr, hp->h_addr_list[0], hp->h_length); |
376 | GNUNET_SERVER_transmit_context_append_data (tc, | 385 | GNUNET_SERVER_transmit_context_append_data (tc, |
377 | &addr, | 386 | &addr, |