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/.
dexter gerrit-no-reply at lists.osmocom.orgHello Neels Hofmeyr, Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/4779
to look at the new patch set (#2).
vty: do not change number_endpoints at runtime
The variable number_endpoints is used as a length indicator
for the array that contains the trunk endpoints at all times.
When osmo-mgw is startet up, the variable is set and osmo-mgw
will allocate the memory for the endpoints. However, it is
still possible to manipulate the variable via the telnet
interface. When the value is increased osmo-mgw might start
using unallocated memory at some point.
Store subsequent changes of number_enspoints in a separate
variable in order to write them to the config file. The
changes will then take effect after a restart.
Change-Id: I3994af016fb96427263edbba05f560743f85fdd4
---
M include/osmocom/mgcp/mgcp.h
M src/libosmo-mgcp/mgcp_vty.c
2 files changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/79/4779/2
diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 42a91d8..c7634fb 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -151,6 +151,7 @@
int rtp_accept_all;
unsigned int number_endpoints;
+ int vty_number_endpoints;
struct mgcp_endpoint *endpoints;
};
diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index 9420d96..26ce300 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -115,7 +115,7 @@
g_cfg->trunk.audio_send_name ? "" : "no ", VTY_NEWLINE);
vty_out(vty, " loop %u%s", ! !g_cfg->trunk.audio_loop, VTY_NEWLINE);
vty_out(vty, " number endpoints %u%s",
- g_cfg->trunk.number_endpoints - 1, VTY_NEWLINE);
+ g_cfg->trunk.vty_number_endpoints - 1, VTY_NEWLINE);
vty_out(vty, " %sallow-transcoding%s",
g_cfg->trunk.no_audio_transcoding ? "no " : "", VTY_NEWLINE);
if (g_cfg->call_agent_addr)
@@ -524,7 +524,7 @@
"Number options\n" "Endpoints available\n" "Number endpoints\n")
{
/* + 1 as we start counting at one */
- g_cfg->trunk.number_endpoints = atoi(argv[0]) + 1;
+ g_cfg->trunk.vty_number_endpoints = atoi(argv[0]) + 1;
return CMD_SUCCESS;
}
@@ -1280,6 +1280,7 @@
cfg->osmux_batch_size = OSMUX_BATCH_DEFAULT_MAX;
g_cfg = cfg;
+
rc = vty_read_config_file(config_file, NULL);
if (rc < 0) {
fprintf(stderr, "Failed to parse the config file: '%s'\n",
@@ -1292,6 +1293,7 @@
return -1;
}
+ g_cfg->trunk.number_endpoints = g_cfg->trunk.vty_number_endpoints;
if (mgcp_endpoints_allocate(&g_cfg->trunk) != 0) {
LOGP(DLMGCP, LOGL_ERROR,
"Failed to initialize the virtual trunk (%d endpoints)\n",
@@ -1300,6 +1302,7 @@
}
llist_for_each_entry(trunk, &g_cfg->trunks, entry) {
+ trunk->number_endpoints = trunk->vty_number_endpoints;
if (mgcp_endpoints_allocate(trunk) != 0) {
LOGP(DLMGCP, LOGL_ERROR,
"Failed to initialize trunk %d (%d endpoints)\n",
--
To view, visit https://gerrit.osmocom.org/4779
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3994af016fb96427263edbba05f560743f85fdd4
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>