about summary refs log tree commit diff
path: root/nis
diff options
context:
space:
mode:
Diffstat (limited to 'nis')
-rw-r--r--nis/nss_nis/nis-ethers.c17
-rw-r--r--nis/nss_nisplus/nisplus-ethers.c11
2 files changed, 7 insertions, 21 deletions
diff --git a/nis/nss_nis/nis-ethers.c b/nis/nss_nis/nis-ethers.c
index c90091748e..f7ff50578e 100644
--- a/nis/nss_nis/nis-ethers.c
+++ b/nis/nss_nis/nis-ethers.c
@@ -24,6 +24,7 @@
 #include <bits/libc-lock.h>
 #include <rpcsvc/yp.h>
 #include <rpcsvc/ypclnt.h>
+#include <netinet/ether.h>
 #include <netinet/if_ether.h>
 
 #include "nss-nis.h"
@@ -31,15 +32,9 @@
 /* Protect global state against multiple changers */
 __libc_lock_define_initialized (static, lock)
 
-struct ether
-{
-  const char *e_name;
-  struct ether_addr e_addr;
-};
-
 /* Get the declaration of the parser function.  */
 #define ENTNAME etherent
-#define STRUCTURE ether
+#define STRUCTURE etherent
 #define EXTERN_PARSER
 #include <nss/nss_files/files-parse.c>
 
@@ -149,7 +144,7 @@ _nss_nis_endetherent (void)
 }
 
 static enum nss_status
-internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen,
+internal_nis_getetherent_r (struct etherent *eth, char *buffer, size_t buflen,
 			    int *errnop)
 {
   struct parser_data *data = (void *) buffer;
@@ -184,7 +179,7 @@ internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen,
 }
 
 enum nss_status
-_nss_nis_getetherent_r (struct ether *result, char *buffer, size_t buflen,
+_nss_nis_getetherent_r (struct etherent *result, char *buffer, size_t buflen,
 			int *errnop)
 {
   int status;
@@ -199,7 +194,7 @@ _nss_nis_getetherent_r (struct ether *result, char *buffer, size_t buflen,
 }
 
 enum nss_status
-_nss_nis_gethostton_r (const char *name, struct ether *eth,
+_nss_nis_gethostton_r (const char *name, struct etherent *eth,
 		       char *buffer, size_t buflen, int *errnop)
 {
   struct parser_data *data = (void *) buffer;
@@ -256,7 +251,7 @@ _nss_nis_gethostton_r (const char *name, struct ether *eth,
 }
 
 enum nss_status
-_nss_nis_getntohost_r (struct ether_addr *addr, struct ether *eth,
+_nss_nis_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
 		       char *buffer, size_t buflen, int *errnop)
 {
   struct parser_data *data = (void *) buffer;
diff --git a/nis/nss_nisplus/nisplus-ethers.c b/nis/nss_nisplus/nisplus-ethers.c
index ddf6f7f128..a8af4569b8 100644
--- a/nis/nss_nisplus/nisplus-ethers.c
+++ b/nis/nss_nisplus/nisplus-ethers.c
@@ -35,15 +35,6 @@ static nis_result *result = NULL;
 static nis_name tablename_val = NULL;
 static u_long tablename_len = 0;
 
-/* Because the `ethers' lookup does not fit so well in the scheme so
-   we define a dummy struct here which helps us to use the available
-   functions.  */
-struct etherent
-{
-  const char *e_name;
-  struct ether_addr e_addr;
-};
-struct etherent_data {};
 
 #define NISENTRYVAL(idx,col,res) \
         ((res)->objects.objects_val[(idx)].zo_data.objdata_u.en_data.en_cols.en_cols_val[(col)].ec_value.ec_value_val)
@@ -53,7 +44,7 @@ struct etherent_data {};
 
 static int
 _nss_nisplus_parse_etherent (nis_result *result, struct etherent *ether,
-			   char *buffer, size_t buflen, int *errnop)
+			     char *buffer, size_t buflen, int *errnop)
 {
   char *p = buffer;
   size_t room_left = buflen;