lynxis lazus has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/25147 )

Change subject: gprs_ns2: dont use llist_for_each when freeing an element
......................................................................


Patch Set 2:

(3 comments)

https://gerrit.osmocom.org/c/libosmocore/+/25147/1/src/gb/gprs_ns2.c
File src/gb/gprs_ns2.c:

https://gerrit.osmocom.org/c/libosmocore/+/25147/1/src/gb/gprs_ns2.c@680
PS1, Line 680:          while (!llist_empty(&nse->nsvc)) {
> would be good to explain in a comment why we don't use the normal 
> llist_for_each_entry_safe here. […]
Ack


https://gerrit.osmocom.org/c/libosmocore/+/25147/1/src/gb/gprs_ns2.c@1490
PS1, Line 1490:
> looks like moving this free loop is fixing a separate issue?
That is true. It fixes an issue that a new nsvc might be created over a bind to 
be removed. So better remove the bind from the entry list first before removing 
the nsvc. The problem is the same. Reacting on events which could be produced 
by removing a NSVC. I'll move this into a separate patch.


https://gerrit.osmocom.org/c/libosmocore/+/25147/1/src/gb/gprs_ns2_sns.c
File src/gb/gprs_ns2_sns.c:

https://gerrit.osmocom.org/c/libosmocore/+/25147/1/src/gb/gprs_ns2_sns.c@1584
PS1, Line 1584:                 while (!llist_empty(&nse->nsvc)) {
> is this because gprs_ns2_free_nsvc() may free multiple nsvc from the list so 
> that it is impossible t […]
Recursive events could happen. E.g. the user (the upper stack or gbproxy, sgsn, 
..) might free the NSVC when receiving an UNAVAILABLE/DOWN event which could 
produce a loop. To be on the safe side I've changed free'ing it.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I902557fb6e56e6588728a46e43a9cbe3215d5c68
Gerrit-Change-Number: 25147
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lyn...@fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-CC: neels <nhofm...@sysmocom.de>
Gerrit-Comment-Date: Thu, 02 Sep 2021 15:35:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofm...@sysmocom.de>
Comment-In-Reply-To: laforge <lafo...@osmocom.org>
Comment-In-Reply-To: dexter <pma...@sysmocom.de>
Gerrit-MessageType: comment

Reply via email to