laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36883?usp=email )
Change subject: ipa: Use pseudo-random number for SLS in IPA->M3UA direction
......................................................................
ipa: Use pseudo-random number for SLS in IPA->M3UA direction
In Change-Id Ice7bab997b84cfed00c7d6d780c70f4e9fac6002 we introduced
code that would make the LSB of the file descriptor be used as SLS
when passing packets from IPA in M3UA direction.
This did however not achieve sufficient entropy in real-world use cases.
In this change, we change over to allocating a pseudo-random SLS to each
IPA connection at the time it is established; We then assign that SLS
to each packet received on that IPA connection.
Change-Id: Ia4e66d660b6057338f66a47fffc8a0d32759f733
Related: SYS#6543
Closes: SYS#6802
---
M src/osmo_ss7_asp.c
M stp/stp_main.c
2 files changed, 32 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/83/36883/1
diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c
index e1c197c..b017510 100644
--- a/src/osmo_ss7_asp.c
+++ b/src/osmo_ss7_asp.c
@@ -906,7 +906,9 @@
}
msg->dst = asp;
rate_ctr_inc2(asp->ctrg, SS7_ASP_CTR_PKT_RX_TOTAL);
- return ipa_rx_msg(asp, msg, ofd->fd & 0xf);
+ /* we simply use the lower 4 bits of the asp_id, which is initialized to a pseudo-random value upon
+ * connect */
+ return ipa_rx_msg(asp, msg, asp->asp_id & 0xf);
}
/* netif code tells us we can read something from the socket */
@@ -996,6 +998,12 @@
if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA) {
rc = ss7_asp_apply_peer_primary_address(asp);
rc = ss7_asp_apply_primary_address(asp);
+ } else {
+ if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA) {
+ /* we use the lower 4 bits of the asp_id feld as SLS; let's initialize it here from a
+ * pseudo-random value */
+ asp->asp_id = rand() & 0xf;
+ }
}
if (asp->lm && asp->lm->prim_cb) {
diff --git a/stp/stp_main.c b/stp/stp_main.c
index 01d1865..d630032 100644
--- a/stp/stp_main.c
+++ b/stp/stp_main.c
@@ -213,6 +213,8 @@
{
int rc;
+ srand(time(NULL));
+
tall_stp_ctx = talloc_named_const(NULL, 1, "osmo-stp");
msgb_talloc_ctx_init(tall_stp_ctx, 0);
osmo_init_logging2(tall_stp_ctx, &log_info);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36883?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: for-1.8
Gerrit-Change-Id: Ia4e66d660b6057338f66a47fffc8a0d32759f733
Gerrit-Change-Number: 36883
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/36882?usp=email )
Change subject: jobs/ttcn3: update ttcn3-ggsn-test-kernel
......................................................................
jobs/ttcn3: update ttcn3-ggsn-test-kernel
Remove ttcn3-ggsn-test-kernel-pablo-gtp, as the IPv6 GTP patches have
been merged. Add ttcn3-ggsn-test-kernel-net-next and
ttcn3-ggsn-test-kernel-torvalds instead, which run the master/nightly
version of osmo-ggsn against HEAD of the kernel trees in
netdev/net-next and torvalds/linux.
Change-Id: I3d2f26ca87f79365f4a407376b5c3c0145f729a6
---
M jobs/ttcn3-testsuites.yml
1 file changed, 41 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/82/36882/1
diff --git a/jobs/ttcn3-testsuites.yml b/jobs/ttcn3-testsuites.yml
index 6780f74..d7646f5 100644
--- a/jobs/ttcn3-testsuites.yml
+++ b/jobs/ttcn3-testsuites.yml
@@ -32,16 +32,24 @@
timer: H 04 * * *
description: |
Test osmo-ggsn master with the Debian kernel.
- - ttcn3-ggsn-test-kernel-pablo-gtp:
+ - ttcn3-ggsn-test-kernel-net-next:
timer: H 04 * * *
# Cache the linux source tree in the workspace of one node
wipe_workspace: false
+ node: ttcn3-ggsn-test-kernel-git
description: |
- Test osmo-ggsn master with the Linux kernel built from main of
- <a href="https://git.kernel.org/pub/scm/linux/kernel/git/pablo/gtp.git/">pablo/gtp.git</a>.
- <br>
- This is a temporary job, to be removed once the IPv6 related GTP
- patches are upstreamed (OS#1952).
+ Test osmo-ggsn master with the Linux kernel built from master of
+ <a href="https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/">
+ net-next.git</a>.
+ - ttcn3-ggsn-test-kernel-torvalds:
+ timer: H 04 * * *
+ # Cache the linux source tree in the workspace of one node
+ wipe_workspace: false
+ node: ttcn3-ggsn-test-kernel-git
+ description: |
+ Test osmo-ggsn master with the Linux kernel built from master of
+ <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/">
+ torvalds/linux.git</a>.
- ttcn3-ggsn-test-kernel-latest:
timer: H 04 * * *
description: |
@@ -266,15 +274,24 @@
# Run against debian's kernel
export KERNEL_TEST=1
;;
- ttcn3-ggsn-test-kernel-pablo-gtp)
+ ttcn3-ggsn-test-kernel-net-next)
DIR="ttcn3-ggsn-test"
export IMAGE_SUFFIX="master"
export KERNEL_TEST=1
export KERNEL_BUILD=1
- export KERNEL_URL="https://git.kernel.org/pub/scm/linux/kernel/git/pablo/gtp.git"
- export KERNEL_REMOTE_NAME="pablo-gtp"
+ export KERNEL_URL="https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git"
+ export KERNEL_REMOTE_NAME="net-next"
export KERNEL_BRANCH="main"
;;
+ ttcn3-ggsn-test-kernel-torvalds)
+ DIR="ttcn3-ggsn-test"
+ export IMAGE_SUFFIX="master"
+ export KERNEL_TEST=1
+ export KERNEL_BUILD=1
+ export KERNEL_URL="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
+ export KERNEL_REMOTE_NAME="torvalds"
+ export KERNEL_BRANCH="master"
+ ;;
ttcn3-ggsn-test-kernel-latest)
DIR="ttcn3-ggsn-test"
export IMAGE_SUFFIX="latest"
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/36882?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I3d2f26ca87f79365f4a407376b5c3c0145f729a6
Gerrit-Change-Number: 36882
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange