Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. gprs_ns2_sns: move selection of the next bind into own function It will be also used by del_bind() when removing an active bind Related: OS#5036 Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d --- M src/gb/gprs_ns2_sns.c 1 file changed, 10 insertions(+), 12 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c index 296a2e7..5d85ec0 100644 --- a/src/gb/gprs_ns2_sns.c +++ b/src/gb/gprs_ns2_sns.c @@ -883,6 +883,15 @@ } } +static void ns2_sns_choose_next_bind(struct ns2_sns_state *gss) +{ + /* take the first bind or take the next bind */ + if (!gss->initial_bind || gss->initial_bind->list.next == >binds) + gss->initial_bind = llist_first_entry_or_null(>binds, struct ns2_sns_bind, list); + else + gss->initial_bind = llist_entry(gss->initial_bind->list.next, struct ns2_sns_bind, list); +} + /* setup all dynamic SNS settings, create a new nsvc and send the SIZE */ static void ns2_sns_st_bss_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state) { @@ -899,18 +908,7 @@ gss->alive = false; ns2_sns_compute_local_ep_from_binds(fi); - - /* take the first bind or take the next bind */ - if (!gss->initial_bind) { - gss->initial_bind = llist_first_entry(>binds, struct ns2_sns_bind, list); - } else { - if (gss->initial_bind->list.next != >binds) { - gss->initial_bind = llist_entry(gss->initial_bind->list.next, struct ns2_sns_bind, list); - } else { - gss->initial_bind = llist_first_entry(>binds, struct ns2_sns_bind, list); - } - } - + ns2_sns_choose_next_bind(gss); /* setup the NSVC */ if (!gss->sns_nsvc) { -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 6 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-MessageType: merged
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 5 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 07 Jun 2021 12:35:57 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 5 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 07 Jun 2021 09:10:47 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
Hello Jenkins Builder, pespin, daniel, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/24122 to look at the new patch set (#5). Change subject: gprs_ns2_sns: move selection of the next bind into own function .. gprs_ns2_sns: move selection of the next bind into own function It will be also used by del_bind() when removing an active bind Related: OS#5036 Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d --- M src/gb/gprs_ns2_sns.c 1 file changed, 10 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/24122/5 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 5 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: pespin Gerrit-Comment-Date: Tue, 25 May 2021 11:07:38 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
Hello Jenkins Builder, pespin, daniel, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/24122 to look at the new patch set (#4). Change subject: gprs_ns2_sns: move selection of the next bind into own function .. gprs_ns2_sns: move selection of the next bind into own function It will be also used by del_bind() when removing an active bind Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d --- M src/gb/gprs_ns2_sns.c 1 file changed, 10 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/24122/4 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. Patch Set 3: (1 comment) https://gerrit.osmocom.org/c/libosmocore/+/24122/2/src/gb/gprs_ns2_sns.c File src/gb/gprs_ns2_sns.c: https://gerrit.osmocom.org/c/libosmocore/+/24122/2/src/gb/gprs_ns2_sns.c@889 PS2, Line 889: if (!gss->initial_bind) { > this can be furhter simplified to: […] Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 24 May 2021 21:21:41 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin Gerrit-MessageType: comment
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
Hello Jenkins Builder, pespin, daniel, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/24122 to look at the new patch set (#3). Change subject: gprs_ns2_sns: move selection of the next bind into own function .. gprs_ns2_sns: move selection of the next bind into own function It will be also used by del_bind() when removing an active bind Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d --- M src/gb/gprs_ns2_sns.c 1 file changed, 10 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/24122/3 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/c/libosmocore/+/24122/2/src/gb/gprs_ns2_sns.c File src/gb/gprs_ns2_sns.c: https://gerrit.osmocom.org/c/libosmocore/+/24122/2/src/gb/gprs_ns2_sns.c@889 PS2, Line 889: if (!gss->initial_bind) { this can be furhter simplified to: if (!gss->initial_bind || ss->initial_bind->list.next == >binds) { gss->initial_bind = llist_first_entry(>binds, struct ns2_sns_bind, list); } else { gss->initial_bind = llist_entry(gss->initial_bind->list.next, struct ns2_sns_bind, list); } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: pespin Gerrit-Comment-Date: Wed, 05 May 2021 09:26:36 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Comment-Date: Tue, 04 May 2021 14:22:20 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/24122 to look at the new patch set (#2). Change subject: gprs_ns2_sns: move selection of the next bind into own function .. gprs_ns2_sns: move selection of the next bind into own function It will be also used by del_bind() when removing an active bind Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d --- M src/gb/gprs_ns2_sns.c 1 file changed, 15 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/24122/2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
Change in libosmocore[master]: gprs_ns2_sns: move selection of the next bind into own function
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/24122 ) Change subject: gprs_ns2_sns: move selection of the next bind into own function .. gprs_ns2_sns: move selection of the next bind into own function It will be also used by del_bind() when removing an active bind Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d --- M src/gb/gprs_ns2_sns.c 1 file changed, 15 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/24122/1 diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c index 296a2e7..852af88 100644 --- a/src/gb/gprs_ns2_sns.c +++ b/src/gb/gprs_ns2_sns.c @@ -883,6 +883,20 @@ } } +static void ns2_sns_choose_next_bind(struct ns2_sns_state *gss) +{ + /* take the first bind or take the next bind */ + if (!gss->initial_bind) { + gss->initial_bind = llist_first_entry(>binds, struct ns2_sns_bind, list); + } else { + if (gss->initial_bind->list.next != >binds) { + gss->initial_bind = llist_entry(gss->initial_bind->list.next, struct ns2_sns_bind, list); + } else { + gss->initial_bind = llist_first_entry(>binds, struct ns2_sns_bind, list); + } + } +} + /* setup all dynamic SNS settings, create a new nsvc and send the SIZE */ static void ns2_sns_st_bss_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state) { @@ -899,18 +913,7 @@ gss->alive = false; ns2_sns_compute_local_ep_from_binds(fi); - - /* take the first bind or take the next bind */ - if (!gss->initial_bind) { - gss->initial_bind = llist_first_entry(>binds, struct ns2_sns_bind, list); - } else { - if (gss->initial_bind->list.next != >binds) { - gss->initial_bind = llist_entry(gss->initial_bind->list.next, struct ns2_sns_bind, list); - } else { - gss->initial_bind = llist_first_entry(>binds, struct ns2_sns_bind, list); - } - } - + ns2_sns_choose_next_bind(gss); /* setup the NSVC */ if (!gss->sns_nsvc) { -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic39f0e5474ecc055d9a1b6a7b30777574d8b741d Gerrit-Change-Number: 24122 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-MessageType: newchange