diff options
author | Ricard Wanderlof <ricard.wanderlof@axis.com> | 2008-06-27 09:08:44 +0000 |
---|---|---|
committer | Ricard Wanderlof <ricard.wanderlof@axis.com> | 2008-06-27 09:08:44 +0000 |
commit | 6c1d86dcdb30f52d7f64179b982b253f1ba6951c (patch) | |
tree | 3886a2a7d4adb43be8ce07188790e27b6c50c22b /libc/inet/ifaddrs.c | |
parent | 516a518c9dfdbdc3c930626f8eeef3d0b4d71236 (diff) |
Added support for the AI_ADDRCONFIG flag in the hints->ai_flags parameter to getaddrinfo(3).
Diffstat (limited to 'libc/inet/ifaddrs.c')
-rw-r--r-- | libc/inet/ifaddrs.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libc/inet/ifaddrs.c b/libc/inet/ifaddrs.c index d1ff8d47f..c60dcf76d 100644 --- a/libc/inet/ifaddrs.c +++ b/libc/inet/ifaddrs.c @@ -22,7 +22,7 @@ #include <alloca.h> #include <assert.h> #include <errno.h> -/*#include <ifaddrs.h>*/ +#include <ifaddrs.h> #include <net/if.h> #include <netinet/in.h> #include <netpacket/packet.h> @@ -57,7 +57,7 @@ libc_hidden_proto(abort) #if __ASSUME_NETLINK_SUPPORT -#if 0 /* unused code */ +#ifdef __UCLIBC_SUPPORT_AI_ADDRCONFIG__ /* struct to hold the data for one ifaddrs entry, so we can allocate everything at once. */ struct ifaddrs_storage @@ -74,7 +74,7 @@ struct ifaddrs_storage } addr, netmask, broadaddr; char name[IF_NAMESIZE + 1]; }; -#endif /* unused code */ +#endif /* __UCLIBC_SUPPORT_AI_ADDRCONFIG__ */ void @@ -324,7 +324,7 @@ __netlink_open (struct netlink_handle *h) } -#if 0 /* unused code */ +#ifdef __UCLIBC_SUPPORT_AI_ADDRCONFIG__ /* We know the number of RTM_NEWLINK entries, so we reserve the first # of entries for this type. All RTM_NEWADDR entries have an index pointer to the RTM_NEWLINK entry. To find the entry, create @@ -562,7 +562,7 @@ getifaddrs (struct ifaddrs **ifap) if ((rta_payload + 1) <= sizeof (ifas[ifa_index].name)) { ifas[ifa_index].ifa.ifa_name = ifas[ifa_index].name; - *(char *) __mempcpy (ifas[ifa_index].name, rta_data, + *(char *) mempcpy (ifas[ifa_index].name, rta_data, rta_payload) = '\0'; } break; @@ -761,7 +761,7 @@ getifaddrs (struct ifaddrs **ifap) if (rta_payload + 1 <= sizeof (ifas[ifa_index].name)) { ifas[ifa_index].ifa.ifa_name = ifas[ifa_index].name; - *(char *) __mempcpy (ifas[ifa_index].name, rta_data, + *(char *) mempcpy (ifas[ifa_index].name, rta_data, rta_payload) = '\0'; } else @@ -872,6 +872,6 @@ freeifaddrs (struct ifaddrs *ifa) } #endif -#endif /* unused code */ +#endif /* __UCLIBC_SUPPORT_AI_ADDRCONFIG__ */ #endif /* __ASSUME_NETLINK_SUPPORT */ |