diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2020-09-21 14:18:36 +0200 |
---|---|---|
committer | dexter <pmaier@sysmocom.de> | 2020-09-29 21:28:59 +0000 |
commit | a208389c0794a09224ea76ed4b6d1ae2c3391d88 (patch) | |
tree | 307a4fccd701c3ec9b4945f814443a4ae3f94eae | |
parent | 37cf40843e1c10e770b11d882cc86ee3828b533b (diff) |
MSC_ConnectionHandler: allow to use IPV4 as default
When the BSC sends a CRCX without an IP address in it, the testcase will
automatically assign an IPV6 address in the response. However, this
breaks compatibility with older versions of osmo-bsc that do not have
IPV6 support. Lets add a module parameter in order to be able to use
IPV4 as default if required.
Change-Id: I30c77abef63636bb02db12d2f2b2d79ea244b96c
-rw-r--r-- | bsc/BSC_Tests.ttcn | 3 | ||||
-rw-r--r-- | bsc/MSC_ConnectionHandler.ttcn | 15 |
2 files changed, 15 insertions, 3 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 7f670d20..34ee4297 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -611,6 +611,8 @@ modulepar { boolean mp_enable_osmux_test := true; /* Value set in osmo-bsc.cfg "ms max power" */ uint8_t mp_exp_ms_power_level := 7; + + boolean mp_media_mgw_offer_ipv6 := true; } private function f_gen_test_hdlr_pars(integer bssap_idx := 0) return TestHdlrParams { @@ -623,6 +625,7 @@ private function f_gen_test_hdlr_pars(integer bssap_idx := 0) return TestHdlrPar } pars.exp_ms_power_level := mp_exp_ms_power_level; pars.mscpool.bssap_idx := bssap_idx; + pars.media_mgw_offer_ipv6 := mp_media_mgw_offer_ipv6; return pars; } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index c3727098..3d6538ab 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -279,7 +279,14 @@ function f_rx_crcx(MgcpCommand mgcp_cmd) var MgcpOsmuxCID osmux_cid; var SDP_Message sdp; var integer cid := f_get_free_mgcp_conn(); - var charstring local_rtp_addr := host_mgw_rtp_v6; /* Use IPv6 by default if no remote addr is provided by client */ + var charstring local_rtp_addr; + + if (g_pars.media_mgw_offer_ipv6 == true) { + local_rtp_addr := host_mgw_rtp_v6; /* Use IPv6 by default if no remote addr is provided by client */ + } else { + local_rtp_addr := host_mgw_rtp_v4; /* Use IPv4 by default if no remote addr is provided by client */ + } + if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { if (cid != 0) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "MGCP wildcard EP only works in first CRCX"); @@ -553,7 +560,8 @@ type record TestHdlrParams { boolean aoip, boolean use_osmux, charstring host_aoip_tla, - TestHdlrParamsMSCPool mscpool + TestHdlrParamsMSCPool mscpool, + boolean media_mgw_offer_ipv6 }; /* Note: Do not use valueof() to get a value of this template, use @@ -587,7 +595,8 @@ template (value) TestHdlrParams t_def_TestHdlrPars := { bssap_idx := 0, rsl_idx := 0, l3_info := omit - } + }, + media_mgw_offer_ipv6 := true } function f_create_chan_and_exp() runs on MSC_ConnHdlr { |