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

laforge gerrit-no-reply at lists.osmocom.org
Thu Mar 4 12:41:56 UTC 2021


laforge has submitted this change. ( 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

Related: OS#3373
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(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index c56b0b5..e19ae78 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: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210304/e2b13ecd/attachment.htm>


More information about the gerrit-log mailing list