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.orglynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22944 ) Change subject: gprs_ns2: ensure no duplicate UDP NSVC can be created ...................................................................... gprs_ns2: ensure no duplicate UDP NSVC can be created Change-Id: I58a95817e2730bbbaa851a43a5b072d1de2db037 --- M src/gb/gprs_ns2_udp.c M src/gb/gprs_ns2_vty.c M tests/gb/gprs_ns2_vty.vty 3 files changed, 33 insertions(+), 0 deletions(-) Approvals: daniel: Looks good to me, but someone else must approve lynxis lazus: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c index 36f6a97..3081680 100644 --- a/src/gb/gprs_ns2_udp.c +++ b/src/gb/gprs_ns2_udp.c @@ -402,6 +402,10 @@ return NULL; } + /* duplicate */ + if (gprs_ns2_nsvc_by_sockaddr_bind(bind, remote)) + return NULL; + sockaddr_str = (char *)osmo_sockaddr_to_str(remote); osmo_identifier_sanitize_buf(sockaddr_str, NULL, '_'); snprintf(idbuf, sizeof(idbuf), "%s-NSE%05u-remote-%s", gprs_ns2_lltype_str(nse->ll), diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c index 4bd7cde..6214907 100644 --- a/src/gb/gprs_ns2_vty.c +++ b/src/gb/gprs_ns2_vty.c @@ -1093,6 +1093,15 @@ goto err; } + nsvc = gprs_ns2_nsvc_by_sockaddr_bind(bind, &remote); + if (nsvc) { + if (nsvc->nse == nse) + vty_out(vty, "Specified NSVC is already present in this NSE.%s", VTY_NEWLINE); + else + vty_out(vty, "Specified NSVC is already present in another NSE%05u.%s", nsvc->nse->nsei, VTY_NEWLINE); + goto err; + } + nsvc = gprs_ns2_ip_connect(bind, &remote, nse, 0); if (!nsvc) { vty_out(vty, "Can not create NS-VC.%s", VTY_NEWLINE); diff --git a/tests/gb/gprs_ns2_vty.vty b/tests/gb/gprs_ns2_vty.vty index a969881..f0253fc 100644 --- a/tests/gb/gprs_ns2_vty.vty +++ b/tests/gb/gprs_ns2_vty.vty @@ -61,3 +61,23 @@ NSVCI 00000: udp)[127.0.0.14]:42999<>[127.0.0.17]:9496 NSVCI 00000: udp)[127.0.0.14]:42999<>[127.0.0.16]:9496 NSVCI 00000: udp)[127.0.0.14]:42999<>[127.0.0.15]:9496 +OsmoNSdummy# configure terminal +OsmoNSdummy(config)# ns +OsmoNSdummy(config-ns)# nse 1234 +OsmoNSdummy(config-ns-nse)# nsvc udp abc 127.0.0.16 9496 signalling-weight 2 data-weight 2 +Specified NSVC is already present in this NSE. +OsmoNSdummy(config-ns-nse)# exit +OsmoNSdummy(config-ns)# nse 1235 +OsmoNSdummy(config-ns-nse)# nsvc udp abc 127.0.0.16 9496 signalling-weight 2 data-weight 2 +Specified NSVC is already present in another NSE01234. +OsmoNSdummy(config-ns-nse)# exit +OsmoNSdummy(config-ns)# nse 2342 +OsmoNSdummy(config-ns-nse)# ip-sns-bind abc +OsmoNSdummy(config-ns-nse)# ip-sns-bind abc +Failed to add ip-sns-bind abc already present +OsmoNSdummy(config-ns-nse)# ip-sns-bind abc2 +Can not find the given bind 'abc2' +OsmoNSdummy(config-ns-nse)# ip-sns-remote 127.0.0.1 22222 +OsmoNSdummy(config-ns-nse)# ip-sns-remote 127.0.0.1 22222 +Specified SNS endpoint already part of the NSE. +OsmoNSdummy(config-ns-nse)# exit -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22944 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I58a95817e2730bbbaa851a43a5b072d1de2db037 Gerrit-Change-Number: 22944 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis at fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann at sysmocom.de> Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu> 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/20210219/752caf92/attachment.htm>