From 77cf6ccf21cffffec35a037cff82cdd69c07b8ea Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 20 Jul 2022 16:31:03 +0200 Subject: [PATCH] add some comments in upf_gtp.c Related: SYS#5599 Change-Id: I58f86cd84207a74e078ae4758bbed76bb1595d95 --- src/osmo-upf/upf_gtp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osmo-upf/upf_gtp.c b/src/osmo-upf/upf_gtp.c index 8eef49f..2c8f89f 100644 --- a/src/osmo-upf/upf_gtp.c +++ b/src/osmo-upf/upf_gtp.c @@ -96,6 +96,8 @@ static int upf_gtp_dev_delete(struct upf_gtp_dev *dev) static int upf_gtp_dev_destruct(struct upf_gtp_dev *dev); +/* Allocate state for one GTP device, add to g_upf->gtp.devs and return the created device. If state for the device of + * that name already exists, do nothing and return NULL. */ static struct upf_gtp_dev *upf_gtp_dev_alloc(const char *name, const char *local_addr) { struct upf_gtp_dev *dev = upf_gtp_dev_find_by_name(name); @@ -260,9 +262,11 @@ int upf_gtp_genl_open() return 0; } + /* Already open? */ if (g_upf->gtp.nl && g_upf->gtp.genl_id >= 0) return 0; + /* sanity / paranoia: if re-opening, make sure the previous socket is closed */ if (g_upf->gtp.nl) upf_gtp_genl_close();