diff --git a/src/modules/Yp/yp.c b/src/modules/Yp/yp.c
index bd2331988549198681526183e0ba36bb6c15130a..9f59252563c055b693b9d44d87f9954cae3f0fe5 100644
--- a/src/modules/Yp/yp.c
+++ b/src/modules/Yp/yp.c
@@ -1,6 +1,9 @@
 #include "config.h"
 
 #if defined(HAVE_RPCSVC_YPCLNT_H) && defined(HAVE_RPCSVC_YP_PROT_H)
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
 #include <rpcsvc/ypclnt.h>
 #include <rpcsvc/yp_prot.h>