gsm0808 + ipa: fix compilation on systems without sys/socket.h

Change-Id: I60f5d4982cd96ab29f9924ec11b46bf56fbfc346
diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index 90cf0eb..fa6a8b0 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -21,13 +21,14 @@
  *
  */
 
+#include "config.h"
+
 #include <unistd.h>
 #include <stdint.h>
 #include <errno.h>
 #include <stdlib.h>
 
 #include <sys/types.h>
-#include <sys/socket.h>
 
 #include <osmocom/core/byteswap.h>
 #include <osmocom/core/msgb.h>
@@ -435,6 +436,9 @@
 	hh->proto = proto;
 }
 
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+
 int ipa_msg_recv(int fd, struct msgb **rmsg)
 {
 	int rc = ipa_msg_recv_buffered(fd, rmsg, NULL);
@@ -564,6 +568,8 @@
 	return ret;
 }
 
+#endif /* SYS_SOCKET_H */
+
 struct msgb *ipa_msg_alloc(int headroom)
 {
 	struct msgb *nmsg;