Change in osmo-sgsn[master]: gbproxy: Separate function to move gbproxy_peer to different nse

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

daniel gerrit-no-reply at lists.osmocom.org
Mon Nov 30 16:15:41 UTC 2020


daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/21418 )


Change subject: gbproxy: Separate function to move gbproxy_peer to different nse
......................................................................

gbproxy: Separate function to move gbproxy_peer to different nse

Change-Id: I0a8b1e4b78384ea99d50109f050ca501b18ba5d9
Related: SYS#5226
---
M include/osmocom/sgsn/gb_proxy.h
M src/gbproxy/gb_proxy.c
M src/gbproxy/gb_proxy_peer.c
3 files changed, 9 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/18/21418/1

diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
index 54d4548..9f91bd6 100644
--- a/include/osmocom/sgsn/gb_proxy.h
+++ b/include/osmocom/sgsn/gb_proxy.h
@@ -344,6 +344,7 @@
 	struct gbproxy_config *cfg, struct tlv_parsed *tp);
 struct gbproxy_peer *gbproxy_peer_alloc(struct gbproxy_nse *nse, uint16_t bvci);
 void gbproxy_peer_free(struct gbproxy_peer *peer);
+void gbproxy_peer_move(struct gbproxy_peer *peer, struct gbproxy_nse *nse);
 int gbproxy_cleanup_peers(struct gbproxy_config *cfg, uint16_t nsei, uint16_t bvci);
 
 /* NSE handling */
diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
index db7f55b..bd58617 100644
--- a/src/gbproxy/gb_proxy.c
+++ b/src/gbproxy/gb_proxy.c
@@ -1114,9 +1114,7 @@
 				LOGP(DGPRS, LOGL_NOTICE, "Peer for BVCI=%u moved from NSEI=%u to NSEI=%u\n", bvci, nse_old->nsei, nsei);
 
 				/* Move peer to different NSE */
-				llist_del(&from_peer->list);
-				llist_add(&from_peer->list, &nse_new->bts_peers);
-				from_peer->nse = nse_new;
+				gbproxy_peer_move(from_peer, nse_new);
 			}
 
 			if (TLVP_PRESENT(&tp, BSSGP_IE_CELL_ID)) {
diff --git a/src/gbproxy/gb_proxy_peer.c b/src/gbproxy/gb_proxy_peer.c
index 920547c..62c4d94 100644
--- a/src/gbproxy/gb_proxy_peer.c
+++ b/src/gbproxy/gb_proxy_peer.c
@@ -253,6 +253,13 @@
 	talloc_free(peer);
 }
 
+void gbproxy_peer_move(struct gbproxy_peer *peer, struct gbproxy_nse *nse)
+{
+	llist_del(&peer->list);
+	llist_add(&peer->list, &nse->bts_peers);
+	peer->nse = nse;
+}
+
 int gbproxy_cleanup_peers(struct gbproxy_config *cfg, uint16_t nsei, uint16_t bvci)
 {
 	int counter = 0;

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I0a8b1e4b78384ea99d50109f050ca501b18ba5d9
Gerrit-Change-Number: 21418
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201130/1da12b4c/attachment.htm>


More information about the gerrit-log mailing list