Commit 82e14b65 authored by Martti Mela's avatar Martti Mela

enable stun in configure; return mapped IPv4 addr for APPLE_CC

darcs-hash:20060117120141-1b897-a21d7d3e1cd9b25265741f6f205f08ca065af45b.gz
parent af6431cb
......@@ -63,8 +63,8 @@ AC_DEFINE([HAVE_SOFIA_SMIME], 0, [Define as 1 if we use S/MIME library])
dnl Disable stun by default while it is broken
AC_ARG_ENABLE(stun,
[ --enable-stun enable stun module (disabled)],
, enable_stun=no)
[ --enable-stun enable stun module (enabled)],
, enable_stun=yes)
if test x$enable_stun = xno ; then
AC_MSG_WARN([** STUN support disabled **])
......
......@@ -376,7 +376,7 @@ int localinfo4(su_localinfo_t const *hints, su_localinfo_t **rresult)
#if defined(__APPLE_CC__)
{
su_sockaddr_t *sa;
int salen = sizeof(*sa);
unsigned int salen = sizeof(*sa);
int scope = 0, gni_flags = 0;
li = calloc(1, sizeof(su_localinfo_t));
......@@ -403,6 +403,14 @@ int localinfo4(su_localinfo_t const *hints, su_localinfo_t **rresult)
if (scope == LI_SCOPE_HOST || scope == LI_SCOPE_LINK)
gni_flags = NI_NUMERICHOST;
if (su_xtra) {
/* Map IPv4 address to IPv6 address */
memset(su, 0, sizeof(*su));
su->su_family = AF_INET6;
((int32_t*)&su->su_sin6.sin6_addr)[3] = su->su_sin.sin_addr.s_addr;
((int32_t*)&su->su_sin6.sin6_addr)[2] = htonl(0xffff);
}
li->li_family = sa->su_family;
li->li_scope = scope;
li->li_index = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment