Change in libosmo-abis[master]: e1inp_input: Fix e1inp_line_clone removing original line from global ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Oct 13 14:43:23 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/25777 )


Change subject: e1inp_input: Fix e1inp_line_clone removing original line from global list when freed
......................................................................

e1inp_input: Fix e1inp_line_clone removing original line from global list when freed

Since a recent commit (see hash below), e1_input.c code was fixed to
release the line from the global line list (e1inp_line_list) before
freeing the object. However, the change didn't have into account that
there were cloned lines from the original one which had a duplicate of
the original line->list. Hence, whenver a clone was freed, it actually
removed the original line from the global list.

Since the original line is the one actually holding the permanent
reference due to being configured over VTY, let's fix e1inp_line_clone
to reset the clone->list so that whenever it is freed it doesn't affect
the original line.

Fixes: 49924f0a79db69c7e180543299a9e1078d5c16ac
Related: SYS#5642
Change-Id: I0627da0d28057649b494e2bd83b283b09fb9a2d7
---
M src/e1_input.c
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/77/25777/1

diff --git a/src/e1_input.c b/src/e1_input.c
index 9fb8a3b..6507835 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -563,6 +563,8 @@
 		.use_cb = e1inp_line_use_cb,
 		.use_counts = {0},
 	};
+	/* initialize list so it can be safely deleted without affecting original line */
+	INIT_LLIST_HEAD(&clone->list);
 	e1inp_line_get2(clone, use); /* Clone is used internally for bfd */
 	return clone;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/25777
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I0627da0d28057649b494e2bd83b283b09fb9a2d7
Gerrit-Change-Number: 25777
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211013/b2d63dde/attachment.htm>


More information about the gerrit-log mailing list