aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-01-13 22:48:25 +0100
committerfixeria <vyanitskiy@sysmocom.de>2021-01-14 12:29:26 +0000
commitcbf1b931f29b31d657dcb112a2139a0987ae3c81 (patch)
tree0f572703b01d8a56158fab68f9c21ce7eeef7c77 /contrib
parentdf1affded8aa0e0402550f0acaf6df06aa988404 (diff)
vty: fix writing empty IP address for unconfigured NSVCs
config_write_bts_gprs() currently writes the remote address of an NSVC even if osmo_sockaddr_str_from_sockaddr() returns non-zero code. Thus saving a configuration with only one configured NSVC to a file would produce the following: bts N ... gprs nsvc 0 nsvci 101 gprs nsvc 0 local udp port 23023 gprs nsvc 0 remote ip 127.0.0.1 gprs nsvc 0 remote udp port 23000 gprs nsvc 1 nsvci 0 gprs nsvc 1 local udp port 0 gprs nsvc 1 remote ip and next time osmo-bsc would refuse to start due to: Error occurred during reading the below line: gprs nsvc 1 remote ip The related condition consists of the following two parts: - checking if osmo_sockaddr_str_from_sockaddr() != 0; - checking if 'remote.af != AF_UNSPEC'. The first one is wrong, because osmo_sockaddr_str_from_sockaddr(), like many other functions, returns 0 on success. Let's fix this. After the fix, the second part does not seem to make sense, because remote.af would remain AF_UNSPEC (0) if the function call succeeds. Printing the remote port alone does not make sense, let's avoid printing it if the address cannot be parsed into a string. Change-Id: I5d6cbde4f605c8184db4ade87de5644a849c05db Fixes: I621360cab1e12c22248e33d62a9929995053ce04
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions