Change in osmo-mgw[master]: mgcp_trunk: drop "trunk 0" limitation
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/19563 ) Change subject: mgcp_trunk: drop "trunk 0" limitation .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/19563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I302c2007628f607033686e277c407232351e66ad Gerrit-Change-Number: 19563 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-CC: pespin Gerrit-Comment-Date: Thu, 20 Aug 2020 06:21:38 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in osmo-mgw[master]: mgcp_trunk: drop "trunk 0" limitation
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/19563 ) Change subject: mgcp_trunk: drop "trunk 0" limitation .. mgcp_trunk: drop "trunk 0" limitation Due to the internal handling of the trunks it was not possible to allow an E1 trunk that has the ID 0. However this limitation is no longer present, so we now can allow an E1 trunk with ID 0. Change-Id: I302c2007628f607033686e277c407232351e66ad Related: OS#2659 --- M src/libosmo-mgcp/mgcp_trunk.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 3 files changed, 5 insertions(+), 10 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_trunk.c b/src/libosmo-mgcp/mgcp_trunk.c index 617993f..84ad220 100644 --- a/src/libosmo-mgcp/mgcp_trunk.c +++ b/src/libosmo-mgcp/mgcp_trunk.c @@ -190,7 +190,7 @@ errno = 0; trunk_nr = strtoul(epname + prefix_len, _trunk_nr_end, 10); - if (errno == ERANGE || trunk_nr > 64 || trunk_nr == 0 + if (errno == ERANGE || trunk_nr > 64 || epname + prefix_len == str_trunk_nr_end || str_trunk_nr_end[0] != '/') return -EINVAL; @@ -217,7 +217,7 @@ } trunk_nr = e1_trunk_nr_from_epname(epname); - if (trunk_nr > 0) + if (trunk_nr >= 0) return mgcp_trunk_by_num(cfg, MGCP_TRUNK_E1, trunk_nr); /* Earlier versions of osmo-mgw were accepting endpoint names diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index d2d4b23..22863c7 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -866,16 +866,11 @@ "IPv4 Address of the callagent\n") DEFUN(cfg_mgcp_trunk, cfg_mgcp_trunk_cmd, - "trunk <1-64>", "Configure a SS7 trunk\n" "Trunk Nr\n") + "trunk <0-64>", "Configure a SS7 trunk\n" "Trunk Nr\n") { struct mgcp_trunk *trunk; int index = atoi(argv[0]); - /* Due to historical reasons, the trunk id number 0 is reserved for the -* virtual trunk. This trunk is configured with separate VTY -* parameters, so we restrict the access to trunks with id numbers -* greater than 0. */ - trunk = mgcp_trunk_by_num(g_cfg, MGCP_TRUNK_E1, index); if (!trunk) { trunk = mgcp_trunk_alloc(g_cfg, MGCP_TRUNK_E1, index); diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 5ae321f..c5b6d17 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -2124,6 +2124,8 @@ /* Note: e1_trunk_nr_from_epname does not check the text * after the E1 trunk number, after the delimiter * character "/" arbitrary text may follow. */ + trunk_nr = e1_trunk_nr_from_epname("ds/e1-0/s-1/su16-0"); + OSMO_ASSERT(trunk_nr == 0); trunk_nr = e1_trunk_nr_from_epname("ds/e1-1/s-1/su16-0"); OSMO_ASSERT(trunk_nr == 1); trunk_nr = e1_trunk_nr_from_epname("ds/e1-2/s-2/su16-0"); @@ -2141,8 +2143,6 @@ * trunk number exceeds the valid range or the trunk prefix * is wrong. Also when the delimiter character "/" at the * end of the trunk is wrong the parsing should fail. */ - trunk_nr = e1_trunk_nr_from_epname("ds/e1-0/s-1/su16-0"); - OSMO_ASSERT(trunk_nr == -EINVAL); trunk_nr = e1_trunk_nr_from_epname("ds/e1-65/s-1/su16-0"); OSMO_ASSERT(trunk_nr == -EINVAL); trunk_nr = e1_trunk_nr_from_epname("ds/e1--1/s-1/su16-0"); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/19563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I302c2007628f607033686e277c407232351e66ad Gerrit-Change-Number: 19563 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-CC: pespin Gerrit-MessageType: merged
Change in osmo-mgw[master]: mgcp_trunk: drop "trunk 0" limitation
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/19563 to look at the new patch set (#2). Change subject: mgcp_trunk: drop "trunk 0" limitation .. mgcp_trunk: drop "trunk 0" limitation Due to the internal handling of the trunks it was not possible to allow an E1 trunk that has the ID 0. However this limitation is no longer present, so we now can allow an E1 trunk with ID 0. Change-Id: I302c2007628f607033686e277c407232351e66ad Related: OS#2659 --- M src/libosmo-mgcp/mgcp_trunk.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 3 files changed, 5 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/63/19563/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/19563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I302c2007628f607033686e277c407232351e66ad Gerrit-Change-Number: 19563 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin Gerrit-MessageType: newpatchset
Change in osmo-mgw[master]: mgcp_trunk: drop "trunk 0" limitation
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/19563 ) Change subject: mgcp_trunk: drop "trunk 0" limitation .. Patch Set 1: Unit tests failing here. -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/19563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I302c2007628f607033686e277c407232351e66ad Gerrit-Change-Number: 19563 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin Gerrit-Comment-Date: Mon, 17 Aug 2020 11:24:13 + Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
Change in osmo-mgw[master]: mgcp_trunk: drop "trunk 0" limitation
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/19563 ) Change subject: mgcp_trunk: drop "trunk 0" limitation .. mgcp_trunk: drop "trunk 0" limitation Due to the internal handling of the trunks it was not possible to allow an E1 trunk that has the ID 0. However this limitation is no longer present, so we now can allow an E1 trunk with ID 0. Change-Id: I302c2007628f607033686e277c407232351e66ad Related: OS#2659 --- M src/libosmo-mgcp/mgcp_trunk.c M src/libosmo-mgcp/mgcp_vty.c 2 files changed, 3 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/63/19563/1 diff --git a/src/libosmo-mgcp/mgcp_trunk.c b/src/libosmo-mgcp/mgcp_trunk.c index 617993f..84ad220 100644 --- a/src/libosmo-mgcp/mgcp_trunk.c +++ b/src/libosmo-mgcp/mgcp_trunk.c @@ -190,7 +190,7 @@ errno = 0; trunk_nr = strtoul(epname + prefix_len, _trunk_nr_end, 10); - if (errno == ERANGE || trunk_nr > 64 || trunk_nr == 0 + if (errno == ERANGE || trunk_nr > 64 || epname + prefix_len == str_trunk_nr_end || str_trunk_nr_end[0] != '/') return -EINVAL; @@ -217,7 +217,7 @@ } trunk_nr = e1_trunk_nr_from_epname(epname); - if (trunk_nr > 0) + if (trunk_nr >= 0) return mgcp_trunk_by_num(cfg, MGCP_TRUNK_E1, trunk_nr); /* Earlier versions of osmo-mgw were accepting endpoint names diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index d2d4b23..22863c7 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -866,16 +866,11 @@ "IPv4 Address of the callagent\n") DEFUN(cfg_mgcp_trunk, cfg_mgcp_trunk_cmd, - "trunk <1-64>", "Configure a SS7 trunk\n" "Trunk Nr\n") + "trunk <0-64>", "Configure a SS7 trunk\n" "Trunk Nr\n") { struct mgcp_trunk *trunk; int index = atoi(argv[0]); - /* Due to historical reasons, the trunk id number 0 is reserved for the -* virtual trunk. This trunk is configured with separate VTY -* parameters, so we restrict the access to trunks with id numbers -* greater than 0. */ - trunk = mgcp_trunk_by_num(g_cfg, MGCP_TRUNK_E1, index); if (!trunk) { trunk = mgcp_trunk_alloc(g_cfg, MGCP_TRUNK_E1, index); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/19563 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I302c2007628f607033686e277c407232351e66ad Gerrit-Change-Number: 19563 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-MessageType: newchange