aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-09 21:40:47 +0700
committerlaforge <laforge@osmocom.org>2020-10-09 15:22:49 +0000
commitdef5a407c108c73aaaf73cfe8f434250d8006b91 (patch)
tree75fd160b8d9c85ac779ddcfd451835275f3ec91f
parent36be9d890ec8f0b64557d5c84ed0c29321f79521 (diff)
socket: make the arguments of osmo_sockaddr_cmp() const
-rw-r--r--include/osmocom/core/socket.h3
-rw-r--r--src/socket.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index 47a372c7..98782406 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -115,7 +115,8 @@ int osmo_sock_local_ip(char *local_ip, const char *remote_ip);
int osmo_sockaddr_local_ip(struct osmo_sockaddr *local_ip,
const struct osmo_sockaddr *remote_ip);
-int osmo_sockaddr_cmp(struct osmo_sockaddr *a, struct osmo_sockaddr *b);
+int osmo_sockaddr_cmp(const struct osmo_sockaddr *a,
+ const struct osmo_sockaddr *b);
#endif /* (!EMBEDDED) */
/*! @} */
diff --git a/src/socket.c b/src/socket.c
index f078242c..93b3d99d 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1690,7 +1690,8 @@ int osmo_sockaddr_local_ip(struct osmo_sockaddr *local_ip, const struct osmo_soc
* \param[in] b
* \return 0 if a and b are equal. Otherwise it follows memcmp()
*/
-int osmo_sockaddr_cmp(struct osmo_sockaddr *a, struct osmo_sockaddr *b)
+int osmo_sockaddr_cmp(const struct osmo_sockaddr *a,
+ const struct osmo_sockaddr *b)
{
if (a == b)
return 0;