From 24f98a0df91ee86fbd39e453d09dc4d48f928e4c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 26 Feb 2020 14:34:53 +0100 Subject: virtual: Fix VTY commands to specify GSMTAP multicast groups osmo-bts-virtual uses GSMTAP over multicast groups to communicate with one or more virtphy instances. There are some well-known default multicast groups, but those can also be overridden via the VTY. The problem is: If you actually try that, osmo-bts-virtual will abort, as we try to talloc_free() when using osmo_talloc_replace_string() on the constant default string. The proper solution is to talloc_strdup() the constant default string when setting the default value in bts_model_phy_link_set_defaults(). Change-Id: Ia96fea891a22e5a3c47ce658eda130ba8d4fc411 --- src/osmo-bts-virtual/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c index c329f3a9..02b7ae92 100644 --- a/src/osmo-bts-virtual/main.c +++ b/src/osmo-bts-virtual/main.c @@ -119,9 +119,9 @@ void bts_model_abis_close(struct gsm_bts *bts) void bts_model_phy_link_set_defaults(struct phy_link *plink) { - plink->u.virt.bts_mcast_group = DEFAULT_BTS_MCAST_GROUP; + plink->u.virt.bts_mcast_group = talloc_strdup(plink, DEFAULT_BTS_MCAST_GROUP); plink->u.virt.bts_mcast_port = DEFAULT_BTS_MCAST_PORT; - plink->u.virt.ms_mcast_group = DEFAULT_MS_MCAST_GROUP; + plink->u.virt.ms_mcast_group = talloc_strdup(plink, DEFAULT_MS_MCAST_GROUP); plink->u.virt.ms_mcast_port = DEFAULT_MS_MCAST_PORT; } -- cgit v1.2.3