Change in libosmocore[master]: gprs_ns2_sns: refactor nss_weight_sum_data -> ip46_weight_sum_data

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

lynxis lazus gerrit-no-reply at lists.osmocom.org
Sun Jun 6 21:38:45 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/24588 )


Change subject: gprs_ns2_sns: refactor nss_weight_sum_data -> ip46_weight_sum_data
......................................................................

gprs_ns2_sns: refactor nss_weight_sum_data -> ip46_weight_sum_data

Allow to use ip46_weight_sum_data for local endpoints as well.

Related: OS#5036
Change-Id: I75d88f3da89ad13e34a3fd5ae72bd967d81f4abc
---
M src/gb/gprs_ns2_sns.c
1 file changed, 7 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/24588/1

diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 66765f3..0badcee 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -209,13 +209,13 @@
 #define ip6_weight_sum_data(elems)		ip6_weight_sum(elems, true)
 #define ip6_weight_sum_sig(elems)		ip6_weight_sum(elems, false)
 
-static int nss_weight_sum(const struct ns2_sns_state *nss, bool data_weight)
+static int ip46_weight_sum(const struct ns2_sns_elems *elems, bool data_weight)
 {
-	return ip4_weight_sum(&nss->remote, data_weight) +
-	       ip6_weight_sum(&nss->remote, data_weight);
+	return ip4_weight_sum(elems, data_weight) +
+	       ip6_weight_sum(elems, data_weight);
 }
-#define nss_weight_sum_data(nss)	nss_weight_sum(nss, true)
-#define nss_weight_sum_sig(nss)		nss_weight_sum(nss, false)
+#define ip46_weight_sum_data(elems)		ip46_weight_sum(elems, true)
+#define ip46_weight_sum_sig(elems)		ip46_weight_sum(elems, false)
 
 static struct gprs_ns2_vc *nsvc_by_ip4_elem(struct gprs_ns2_nse *nse,
 					    const struct gprs_ns_ie_ip4_elem *ip4)
@@ -1067,7 +1067,7 @@
 		}
 		if (event == GPRS_SNS_EV_RX_CONFIG_END) {
 			/* check if sum of data / sig weights == 0 */
-			if (nss_weight_sum_data(gss) == 0 || nss_weight_sum_sig(gss) == 0) {
+			if (ip46_weight_sum_data(&gss->remote) == 0 || ip46_weight_sum_sig(&gss->remote) == 0) {
 				cause = NS_CAUSE_INVAL_WEIGH;
 				ns2_tx_sns_config_ack(gss->sns_nsvc, &cause);
 				osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_UNCONFIGURED, 0, 0);
@@ -2094,7 +2094,7 @@
 		/* only change state if last CONFIG was received */
 		if (event == GPRS_SNS_EV_RX_CONFIG_END) {
 			/* ensure sum of data weight / sig weights is > 0 */
-			if (nss_weight_sum_data(gss) == 0 || nss_weight_sum_sig(gss) == 0) {
+			if (ip46_weight_sum_data(&gss->remote) == 0 || ip46_weight_sum_sig(&gss->remote) == 0) {
 				cause = NS_CAUSE_INVAL_WEIGH;
 				ns2_tx_sns_config_ack(gss->sns_nsvc, &cause);
 				osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_UNCONFIGURED, 0, 0);

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I75d88f3da89ad13e34a3fd5ae72bd967d81f4abc
Gerrit-Change-Number: 24588
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210606/ba81a362/attachment.htm>


More information about the gerrit-log mailing list