neels submitted this change.
add some comments in upf_gtp.c
Related: SYS#5599
Change-Id: I58f86cd84207a74e078ae4758bbed76bb1595d95
---
M src/osmo-upf/upf_gtp.c
1 file changed, 4 insertions(+), 0 deletions(-)
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_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 @@
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();
To view, visit change 28707. To unsubscribe, or for help writing mail filters, visit settings.