lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39015?usp=email )
Change subject: gprs_ns2_sns: improve search for same NS-VC
......................................................................
gprs_ns2_sns: improve search for same NS-VC
Adding a second NS-VC with the same IP+UDP isn't possible,
even when the weights are different, because the NS-ALIVE wouldn't work.
Also a NS-VC is identified by IP+UDP and not by the weights.
IPv6 did this already. Use the same logic for IPv4.
Further relax the search of NS-VC when removing NS-VC. Only take care
of IP+UDP and ignore signalling weight and data weights.
Related: OS#6611
Change-Id: Ibbc1a794a9a9f0ce6e583fd9743e7f02d52a99cf
---
M src/gb/gprs_ns2_sns.c
1 file changed, 7 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/39015/1
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 6b92370..a17861b 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -501,7 +501,8 @@
{
/* check for duplicates */
for (unsigned int i = 0; i < elems->num_ip4; i++) {
- if (memcmp(&elems->ip4[i], ip4, sizeof(*ip4)))
+ if (elems->ip4[i].ip_addr != ip4->ip_addr ||
+ elems->ip4[i].udp_port != ip4->udp_port)
continue;
return -1;
}
@@ -520,8 +521,10 @@
unsigned int i;
for (i = 0; i < elems->num_ip4; i++) {
- if (memcmp(&elems->ip4[i], ip4, sizeof(*ip4)))
+ if (elems->ip4[i].ip_addr != ip4->ip_addr ||
+ elems->ip4[i].udp_port != ip4->udp_port)
continue;
+
/* all array elements < i remain as they are; all > i are shifted left by one */
memmove(&elems->ip4[i], &elems->ip4[i+1], elems->num_ip4-i-1);
elems->num_ip4 -= 1;
@@ -574,7 +577,8 @@
unsigned int i;
for (i = 0; i < elems->num_ip6; i++) {
- if (memcmp(&elems->ip6[i], ip6, sizeof(*ip6)))
+ if (memcmp(&elems->ip6[i].ip_addr, &ip6->ip_addr, sizeof(ip6->ip_addr)) ||
+ elems->ip6[i].udp_port != ip6->udp_port)
continue;
/* all array elements < i remain as they are; all > i are shifted left by one */
memmove(&elems->ip6[i], &elems->ip6[i+1], elems->num_ip6-i-1);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39015?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibbc1a794a9a9f0ce6e583fd9743e7f02d52a99cf
Gerrit-Change-Number: 39015
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39012?usp=email )
Change subject: gprs_ns2_sns: add include osmocom/core/talloc.h
......................................................................
gprs_ns2_sns: add include osmocom/core/talloc.h
Talloc is directly used, do an explicit include talloc
and not depend on a another header to include it.
Change-Id: I867c5e3f87efcf5bcc99713a0c1dcaecfc55fcbd
---
M src/gb/gprs_ns2_sns.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/39012/1
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 0afc06e..dbfc332 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -47,6 +47,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/sockaddr_str.h>
+#include <osmocom/core/talloc.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/gprs/gprs_ns2.h>
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39012?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I867c5e3f87efcf5bcc99713a0c1dcaecfc55fcbd
Gerrit-Change-Number: 39012
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39014?usp=email )
Change subject: gprs_ns2_sns: move the NS-ALIVE PDU of a new NS-VC after the SNS-ACK
......................................................................
gprs_ns2_sns: move the NS-ALIVE PDU of a new NS-VC after the SNS-ACK
When adding a new NS-VC after the SNS-CONFIG is done, the new NS-VC would send out a
NS-ALIVE before sending out the SNS-ACK towards the remote NSE.
This isn't a big issue, because the SNS-ACK can be reordered by the network anyways,
but be nice and ensure the order matches the expectation.
Related: OS#6611
Change-Id: I6503bbb32b4440eb53f8c9bd03572f4a189f1a86
---
M src/gb/gprs_ns2_sns.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/39014/1
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index de0400f..6b92370 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -792,8 +792,6 @@
break;
}
- gprs_ns2_start_alive_all_nsvcs(nse);
-
return 0;
}
@@ -1267,6 +1265,8 @@
/* TODO: correct behaviour is to answer to the *same* NSVC from which the SNS_ADD was received */
ns2_tx_sns_ack(gss->sns_nsvc, trans_id, NULL, v4_list, num_v4, v6_list, num_v6);
+
+ gprs_ns2_start_alive_all_nsvcs(gss->nse);
}
static void ns2_sns_st_configured_delete(struct osmo_fsm_inst *fi,
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39014?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6503bbb32b4440eb53f8c9bd03572f4a189f1a86
Gerrit-Change-Number: 39014
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>