Change in osmo-bsc[master]: vty: fix writing empty IP address for unconfigured NSVCs

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Wed Jan 13 22:35:31 UTC 2021


fixeria has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-bsc/+/22164 )

Change subject: vty: fix writing empty IP address for unconfigured NSVCs
......................................................................

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
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 9 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/64/22164/2
-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/22164
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5d6cbde4f605c8184db4ade87de5644a849c05db
Gerrit-Change-Number: 22164
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210113/eaec36ed/attachment.htm>


More information about the gerrit-log mailing list