aboutsummaryrefslogtreecommitdiff
path: root/inet/ether_ntoh.c
diff options
context:
space:
mode:
Diffstat (limited to 'inet/ether_ntoh.c')
-rw-r--r--inet/ether_ntoh.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/inet/ether_ntoh.c b/inet/ether_ntoh.c
index ecddc9d8ac..ad4165cb3e 100644
--- a/inet/ether_ntoh.c
+++ b/inet/ether_ntoh.c
@@ -40,25 +40,29 @@ ether_ntohost (char *hostname, const struct ether_addr *addr)
static service_user *startp;
static lookup_function start_fct;
service_user *nip;
- lookup_function fct;
+ union
+ {
+ lookup_function f;
+ void *ptr;
+ } fct;
int no_more;
enum nss_status status = NSS_STATUS_UNAVAIL;
struct etherent etherent;
if (startp == NULL)
{
- no_more = __nss_ethers_lookup (&nip, "getntohost_r", (void **) &fct);
+ no_more = __nss_ethers_lookup (&nip, "getntohost_r", &fct.ptr);
if (no_more)
startp = (service_user *) -1;
else
{
startp = nip;
- start_fct = fct;
+ start_fct = fct.f;
}
}
else
{
- fct = start_fct;
+ fct.f = start_fct;
no_more = (nip = startp) == (service_user *) -1;
}
@@ -66,9 +70,9 @@ ether_ntohost (char *hostname, const struct ether_addr *addr)
{
char buffer[1024];
- status = (*fct) (addr, &etherent, buffer, sizeof buffer, &errno);
+ status = (*fct.f) (addr, &etherent, buffer, sizeof buffer, &errno);
- no_more = __nss_next (&nip, "getntohost_r", (void **) &fct, status, 0);
+ no_more = __nss_next (&nip, "getntohost_r", &fct.ptr, status, 0);
}
if (status == NSS_STATUS_SUCCESS)