Change in libosmocore[master]: socket.h: add missing include

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Mon Feb 4 13:48:22 UTC 2019


Max has submitted this change and it was merged. ( https://gerrit.osmocom.org/12823 )

Change subject: socket.h: add missing include
......................................................................

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
---
M include/osmocom/core/socket.h
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index c183532..e06f926 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 @@
 #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);

-- 
To view, visit https://gerrit.osmocom.org/12823
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2883addcb81cec038577e401e356e8f07a947d4c
Gerrit-Change-Number: 12823
Gerrit-PatchSet: 4
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190204/62289634/attachment.htm>


More information about the gerrit-log mailing list