Include sys/types.h before sys/socket.h.

diff --git a/configure b/configure
index 87e53be..b96b12e 100755
--- a/configure
+++ b/configure
@@ -11634,7 +11634,10 @@
   cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 #include "confdefs.h"
-#if HAVE_SYS_SOCKET_H
+#if HAVE_SYS_TYPES_H
+     # include <sys/types.h>
+     #endif
+     #if HAVE_SYS_SOCKET_H
      # include <sys/socket.h>
      #endif
 
diff --git a/configure.ac b/configure.ac
index 91d3505..8c2a857 100644
--- a/configure.ac
+++ b/configure.ac
@@ -974,7 +974,10 @@
 
 dnl *** Check for net/if.h
 AC_CHECK_HEADERS(net/if.h,,,
-    [#if HAVE_SYS_SOCKET_H
+    [#if HAVE_SYS_TYPES_H
+     # include <sys/types.h>
+     #endif
+     #if HAVE_SYS_SOCKET_H
      # include <sys/socket.h>
      #endif])