From aa89f5dffced73ee9e7267739193771e6d143b89 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 28 Aug 2019 16:08:45 +0200 Subject: gtp: make echo_interval unsigned There's no real need to use -1 to indicate echo timer as disabled, since 0 can also be used (it doesn't make sense to have a timer timeout of 0). This way code is simplified. Change-Id: I689034887188a53590eddeffda781629694eb5ed --- src/gprs/gprs_sgsn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gprs/gprs_sgsn.c') diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 9f02d5420..7174bd5e2 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -500,7 +500,7 @@ void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc) bool pending = osmo_timer_pending(&ggc->echo_timer); /* Only enable if allowed by policy and at least 1 pdp ctx exists against ggsn */ - if (!llist_empty(&ggc->pdp_list) && ggc->echo_interval > 0) { + if (!llist_empty(&ggc->pdp_list) && ggc->echo_interval) { if (!pending) osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); } else { @@ -528,7 +528,6 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id) ggc->id = id; ggc->gtp_version = 1; ggc->remote_restart_ctr = -1; - ggc->echo_interval = -1; /* if we are called from config file parse, this gsn doesn't exist yet */ ggc->gsn = sgsn->gsn; INIT_LLIST_HEAD(&ggc->pdp_list); -- cgit v1.2.3