diff options
author | Harald Welte <laforge@osmocom.org> | 2020-02-26 14:34:53 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-02-26 14:36:58 +0100 |
commit | 24f98a0df91ee86fbd39e453d09dc4d48f928e4c (patch) | |
tree | 7b01425d325029cdef8e2e4b6c1acfe2ebe915bc /src/osmo-bts-virtual | |
parent | 6ea3b2832130815808c530491aaa0f06219a02ae (diff) |
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
Diffstat (limited to 'src/osmo-bts-virtual')
-rw-r--r-- | src/osmo-bts-virtual/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |