Commit be6182a7 authored by Martti Mela's avatar Martti Mela

OS X specific localinfo stuff

darcs-hash:20060116173244-1b897-be77317eeea50c557beb98ee015a3a2a7a7090f5.gz
parent 7a1929a1
......@@ -364,6 +364,38 @@ int localinfo4(su_localinfo_t const *hints, su_localinfo_t **rresult)
return ELI_SYSTEM;
}
#if defined(__APPLE_CC__)
{
su_sockaddr_t *sa;
int salen = sizeof(sa.su_sin);
int scope;
li = calloc(1, sizeof(su_localinfo_t));
sa = calloc(1, sizeof(su_sockaddr_t));
error = bind(s, sa, salen);
if (error < 0)
goto err;
su_close(s);
scope = li_scope4(sa->su_sin.sin_addr.s_addr);
li->li_family = sa->su_family;
li->li_flags = LI_NUMERIC;
li->li_scope = scope;
li->li_index = 0;
li->li_addrlen = su_sockaddr_size(sa);
li->li_addr = sa;
li->li_canonname = NULL;
*rresult = li;
return 0;
}
#endif
# if HAVE_IFNUM
/* Get the list of known IP address from the kernel */
if (ioctl(s, SIOCGIFNUM, (char *) &numifs) < 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