From a55900aaecc39b106b6780c12814fcdd53c0e99f Mon Sep 17 00:00:00 2001 From: Liviu Chircu Date: Sat, 11 May 2024 23:13:43 +0300 Subject: [PATCH] proto_ipsec: Fix various compile warnings --- modules/proto_ipsec/ipsec.c | 3 ++- modules/proto_ipsec/ipsec_user.c | 3 ++- modules/proto_ipsec/proto_ipsec.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/proto_ipsec/ipsec.c b/modules/proto_ipsec/ipsec.c index d021425a1ba..4d011307e78 100644 --- a/modules/proto_ipsec/ipsec.c +++ b/modules/proto_ipsec/ipsec.c @@ -837,8 +837,9 @@ void ipsec_ctx_release_tmp_user(struct ipsec_user *user) void ipsec_ctx_release_user(struct ipsec_ctx *ctx) { - int release; + int release = 0; struct ipsec_user *user = ctx->user; + lock_get(&user->lock); if (list_is_valid(&ctx->list)) { list_del(&ctx->list); diff --git a/modules/proto_ipsec/ipsec_user.c b/modules/proto_ipsec/ipsec_user.c index 593b3b35a47..cbd66c4e6e7 100644 --- a/modules/proto_ipsec/ipsec_user.c +++ b/modules/proto_ipsec/ipsec_user.c @@ -104,7 +104,8 @@ void ipsec_dump_users_rec(struct ipsec_map_node *nodes, int size, unsigned char impi = list_entry(it, struct ipsec_user_impi, list); list_for_each(it2, &impi->users) { user = list_entry(it2, struct ipsec_user, list); - LM_DBG("print %hu.%hu.%hu.%hu - %.*s/%.*s\n", buf[0], buf[1], buf[2], buf[3], + LM_DBG("print %u.%u.%u.%u - %.*s/%.*s\n", + (unsigned)buf[0], (unsigned)buf[1], (unsigned)buf[2], (unsigned)buf[3], user->impi.len, user->impi.s, user->impu.len, user->impu.s); } } diff --git a/modules/proto_ipsec/proto_ipsec.c b/modules/proto_ipsec/proto_ipsec.c index 90b4bd0358c..683a1bc35fc 100644 --- a/modules/proto_ipsec/proto_ipsec.c +++ b/modules/proto_ipsec/proto_ipsec.c @@ -316,7 +316,7 @@ static int proto_ipsec_add_listeners(void) si->flags |= SI_INTERNAL; udp = new_sock_info(si); if (!udp) { - LM_ERR("could not add UDP listening sucket for %s:%hu\n", + LM_ERR("could not add UDP listening sucket for %s:%d\n", si->name, si->port); return -1; } @@ -326,7 +326,7 @@ static int proto_ipsec_add_listeners(void) si->flags |= SI_REUSEPORT; tcp = new_sock_info(si); if (!tcp) { - LM_ERR("could not add TCP listening sucket for %s:%hu\n", + LM_ERR("could not add TCP listening sucket for %s:%d\n", si->name, si->port); return -1; }