Change in libosmocore[master]: NS2: Fix bind selection of SNS NSVCs

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/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Jan 14 18:09:44 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22193 )

Change subject: NS2: Fix bind selection of SNS NSVCs
......................................................................

NS2: Fix bind selection of SNS NSVCs

The SNS code ignored the link type of the bind and just bound to every
bind it could find. This resulted in a segfault when an SNS NSVC tries
to send its UDP messages though frame relay.

Fixes: OS#4948
Change-Id: Ibb832a39876362d094cce635192f7b4f84dc2b10
---
M src/gb/gprs_ns2_sns.c
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  lynxis lazus: 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 2cb4293..1958477 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -270,6 +270,8 @@
 
 	/* for every bind, create a connection if bind type == IP */
 	llist_for_each_entry(bind, &nsi->binding, list) {
+		if (bind->ll != GPRS_NS2_LL_UDP)
+			continue;
 		/* ignore failed connection */
 		nsvc = gprs_ns2_ip_connect_inactive(bind,
 					   &remote,
@@ -299,6 +301,8 @@
 
 	/* for every bind, create a connection if bind type == IP */
 	llist_for_each_entry(bind, &nsi->binding, list) {
+		if (bind->ll != GPRS_NS2_LL_UDP)
+			continue;
 		/* ignore failed connection */
 		nsvc = gprs_ns2_ip_connect_inactive(bind,
 					   &remote,
@@ -332,6 +336,8 @@
 
 		llist_for_each_entry(bind, &nse->nsi->binding, list) {
 			bool found = false;
+			if (bind->ll != GPRS_NS2_LL_UDP)
+				continue;
 
 			llist_for_each_entry(nsvc, &nse->nsvc, list) {
 				if (nsvc->bind != bind)
@@ -367,6 +373,8 @@
 
 		llist_for_each_entry(bind, &nse->nsi->binding, list) {
 			bool found = false;
+			if (bind->ll != GPRS_NS2_LL_UDP)
+				continue;
 
 			llist_for_each_entry(nsvc, &nse->nsvc, list) {
 				if (nsvc->bind != bind)

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibb832a39876362d094cce635192f7b4f84dc2b10
Gerrit-Change-Number: 22193
Gerrit-PatchSet: 2
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210114/49d7cb3e/attachment.htm>


More information about the gerrit-log mailing list