Change in libosmocore[master]: gprs_ns2: Pass peer/remote sockaddr argument to ns2_create_vc()

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 Mar 4 08:56:33 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/23224 )


Change subject: gprs_ns2: Pass peer/remote sockaddr argument to ns2_create_vc()
......................................................................

gprs_ns2: Pass peer/remote sockaddr argument to ns2_create_vc()

This is a preparation towards auto-creating SNS NS-VCs in SGSN role

Change-Id: Idf92712079cd9b7e4ff2cf8df314b372d63e6e52
---
M src/gb/gprs_ns2.c
M src/gb/gprs_ns2_frgre.c
M src/gb/gprs_ns2_internal.h
M src/gb/gprs_ns2_udp.c
4 files changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/24/23224/1

diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index a79dd05..4a98374 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -868,12 +868,14 @@
 /*! Create a new NS-VC based on a [received] message. Depending on the bind it might create a NSE.
  *  \param[in] bind the bind through which msg was received
  *  \param[in] msg the actual received message
+ *  \param[in] remote address of remote peer sending message
  *  \param[in] logname A name to describe the VC. E.g. ip address pair
  *  \param[out] reject A message filled to be sent back. Only used in failure cases.
  *  \param[out] success A pointer which will be set to the new VC on success
  *  \return enum value indicating the status, e.g. GPRS_NS2_CS_CREATED */
 enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind,
 			  struct msgb *msg,
+			  const struct osmo_sockaddr *remote,
 			  const char *logname,
 			  struct msgb **reject,
 			  struct gprs_ns2_vc **success)
diff --git a/src/gb/gprs_ns2_frgre.c b/src/gb/gprs_ns2_frgre.c
index 62d87a4..76c0b92 100644
--- a/src/gb/gprs_ns2_frgre.c
+++ b/src/gb/gprs_ns2_frgre.c
@@ -447,7 +447,7 @@
 	rc = ns2_find_vc_by_dlci(bind, dlci, &nsvc);
 	if (rc) {
 		/* VC not found */
-		rc = ns2_create_vc(bind, msg, "newconnection", &reject, &nsvc);
+		rc = ns2_create_vc(bind, msg, &saddr, "newconnection", &reject, &nsvc);
 		switch (rc) {
 		case NS2_CS_FOUND:
 			break;
diff --git a/src/gb/gprs_ns2_internal.h b/src/gb/gprs_ns2_internal.h
index 7e235be..80e664c 100644
--- a/src/gb/gprs_ns2_internal.h
+++ b/src/gb/gprs_ns2_internal.h
@@ -279,6 +279,7 @@
 
 enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind,
 			       struct msgb *msg,
+			       const struct osmo_sockaddr *remote,
 			       const char *logname,
 			       struct msgb **reject,
 			       struct gprs_ns2_vc **success);
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index 3081680..5765c77 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -231,7 +231,7 @@
 	nsvc = gprs_ns2_nsvc_by_sockaddr_bind(bind, &saddr);
 	if (!nsvc) {
 		/* VC not found */
-		rc = ns2_create_vc(bind, msg, "newconnection", &reject, &nsvc);
+		rc = ns2_create_vc(bind, msg, &saddr, "newconnection", &reject, &nsvc);
 		switch (rc) {
 		case NS2_CS_FOUND:
 			break;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Idf92712079cd9b7e4ff2cf8df314b372d63e6e52
Gerrit-Change-Number: 23224
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210304/33c0ca6b/attachment.htm>


More information about the gerrit-log mailing list