summaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-02-04 14:06:31 +0100
committerMax <msuraev@sysmocom.de>2019-02-04 13:48:22 +0000
commitb3e9b313838fe4c80acdf0a95e0cd9609370f8f2 (patch)
tree357bd824a909aa999153a8b1777896e5f52918f4 /include/osmocom
parentd6ff9c8315dfc7137ea68a2d59b8fffcad138adf (diff)
socket.h: add missing include
socket.h uses INET6_ADDRSTRLEN without including arpa/inet.h where it's defined which might break external users of socket.h Fix this by adding missing include. The error was introduced in 64b51eb68bd272b6b1f2cefa2b33e9dd74024d0c Change-Id: I2883addcb81cec038577e401e356e8f07a947d4c
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/socket.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index c1835326..e06f926f 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -11,6 +11,13 @@
#include <stdbool.h>
#include <stddef.h>
+#if (!EMBEDDED)
+#include <arpa/inet.h>
+
+/*! maximum length of a socket name ("r=1.2.3.4:123<->l=5.6.7.8:987") */
+#define OSMO_SOCK_NAME_MAXLEN (2 + INET6_ADDRSTRLEN + 1 + 5 + 3 + 2 + INET6_ADDRSTRLEN + 1 + 5 + 1)
+#endif
+
struct sockaddr_in;
struct sockaddr;
struct osmo_fd;
@@ -28,8 +35,6 @@ struct osmo_fd;
#define OSMO_SOCK_F_NO_MCAST_ALL (1 << 4)
/*! use SO_REUSEADDR on UDP ports (required for multicast) */
#define OSMO_SOCK_F_UDP_REUSEADDR (1 << 5)
-/*! maximum length of a socket name ("r=1.2.3.4:123<->l=5.6.7.8:987") */
-#define OSMO_SOCK_NAME_MAXLEN (2 + INET6_ADDRSTRLEN + 1 + 5 + 3 + 2 + INET6_ADDRSTRLEN + 1 + 5 + 1)
int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto,
const char *host, uint16_t port, unsigned int flags);