aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-03-24 13:22:18 +0100
committerdaniel <dwillmann@sysmocom.de>2021-03-24 16:18:15 +0000
commit3053bbb3f32ac312fe9c51983574a4f9b2d8dbe5 (patch)
treeb0d4735318f83b6ed87eaa535f7c65e9cc5b4a60 /src
parente8c6106c2e02d3055c705aed415ea43b2f849a2f (diff)
gprs_ns2_sns: Don't create NS-VCs for binds outside the NSE
We may very well have any number of binds configured, but which are not part of the current NSE. When creating the "full mesh" of NS-VCs after SNS-CONFIG, we must only iterate over those binds that are part of the NSE (or 'ipa-sns-default bind' in cae of SGSN role), but not over all the other binds that may exist in the system. Closes: OS#5092 Change-Id: Ida361fa02ad1d86844d54c8f0664c996ed28e30a
Diffstat (limited to 'src')
-rw-r--r--src/gb/gprs_ns2_sns.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 2370f01c..b07f010a 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -388,7 +388,7 @@ static int create_missing_nsvcs(struct osmo_fsm_inst *fi)
struct ns2_sns_state *gss = (struct ns2_sns_state *) fi->priv;
struct gprs_ns2_nse *nse = nse_inst_from_fi(fi);
struct gprs_ns2_vc *nsvc;
- struct gprs_ns2_vc_bind *bind;
+ struct ns2_sns_bind *sbind;
struct osmo_sockaddr remote = { };
unsigned int i;
@@ -400,8 +400,10 @@ static int create_missing_nsvcs(struct osmo_fsm_inst *fi)
remote.u.sin.sin_addr.s_addr = ip4->ip_addr;
remote.u.sin.sin_port = ip4->udp_port;
- /* iterate over all local binds */
- llist_for_each_entry(bind, &nse->nsi->binding, list) {
+ /* iterate over all local binds within this SNS */
+ llist_for_each_entry(sbind, &gss->binds, list) {
+ struct gprs_ns2_vc_bind *bind = sbind->bind;
+
/* we only care about UDP binds */
if (bind->ll != GPRS_NS2_LL_UDP)
continue;
@@ -430,8 +432,10 @@ static int create_missing_nsvcs(struct osmo_fsm_inst *fi)
remote.u.sin6.sin6_addr = ip6->ip_addr;
remote.u.sin6.sin6_port = ip6->udp_port;
- /* iterate over all local binds */
- llist_for_each_entry(bind, &nse->nsi->binding, list) {
+ /* iterate over all local binds within this SNS */
+ llist_for_each_entry(sbind, &gss->binds, list) {
+ struct gprs_ns2_vc_bind *bind = sbind->bind;
+
if (bind->ll != GPRS_NS2_LL_UDP)
continue;