about summary refs log tree commit diff
path: root/inet/ether_hton.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2002-11-10 11:06:36 +0000
committerAndreas Jaeger <aj@suse.de>2002-11-10 11:06:36 +0000
commitfb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff (patch)
treeb6d3b7b6350601fbb8f6cbf8f820d25c0ab59cdb /inet/ether_hton.c
parent55c303acb873e478540042612f1028139454d4a4 (diff)
downloadglibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.tar.gz
glibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.tar.xz
glibc-fb776f3ef3b2b7eaf7e92305b8b2dc480f31f3ff.zip
* nss/getXXent.c (GETFUNC_NAME): Use union type to avoid strict
aliasing problem. 
* nss/getXXbyYY_r.c (INTERNAL): Likewise. 
* nss/getnssent_r.c (__nss_getent_r): Likewise. 
(__nss_setent): Likewise. 
(__nss_getent_r): Likewise. 
* inet/getnetgrent_r.c (innetgr): Likewise. 
(__internal_setnetgrent_reuse): Likewise. 
(internal_getnetgrent_r): Likewise. 
* inet/ether_hton.c (ether_hostton): Likewise. 
* inet/ether_ntoh.c (ether_ntohost): Likewise. 
* sunrpc/netname.c (netname2user): Likewise. 
* sunrpc/publickey.c (getpublickey): Likewise. 
(getsecretkey): Likewise.
Diffstat (limited to 'inet/ether_hton.c')
-rw-r--r--inet/ether_hton.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/inet/ether_hton.c b/inet/ether_hton.c
index 70dc2fe071..64f5ab5d36 100644
--- a/inet/ether_hton.c
+++ b/inet/ether_hton.c
@@ -39,25 +39,29 @@ ether_hostton (const char *hostname, 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, "gethostton_r", (void **) &fct);
+      no_more = __nss_ethers_lookup (&nip, "gethostton_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;
     }
 
@@ -65,9 +69,9 @@ ether_hostton (const char *hostname, struct ether_addr *addr)
     {
       char buffer[1024];
 
-      status = (*fct) (hostname, &etherent, buffer, sizeof buffer, &errno);
+      status = (*fct.f) (hostname, &etherent, buffer, sizeof buffer, &errno);
 
-      no_more = __nss_next (&nip, "gethostton_r", (void **) &fct, status, 0);
+      no_more = __nss_next (&nip, "gethostton_r", &fct.ptr, status, 0);
     }
 
   if (status == NSS_STATUS_SUCCESS)