[PATCH 6/6] bsc_nat: fail if VTY telnet port cannot be bound

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/OpenBSC@lists.osmocom.org/.

Neels Hofmeyr nhofmeyr at sysmocom.de
Wed Feb 24 03:57:01 UTC 2016


---
 openbsc/src/osmo-bsc_nat/bsc_nat.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 8404e41..cdab406 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1638,10 +1638,13 @@ int main(int argc, char **argv)
 	/* start telnet after reading config for vty_get_bind_addr() */
 	LOGP(DNAT, LOGL_NOTICE, "VTY at %s %d\n",
 	     vty_get_bind_addr(), OSMO_VTY_PORT_BSC_NAT);
-	telnet_init_dynif(tall_bsc_ctx, NULL, vty_get_bind_addr(),
-			  OSMO_VTY_PORT_BSC_NAT);
+	if (telnet_init_dynif(tall_bsc_ctx, NULL, vty_get_bind_addr(),
+			      OSMO_VTY_PORT_BSC_NAT)) {
+		fprintf(stderr, "Creating VTY telnet line failed\n");
+		return -5;
+	}
 
-	/* over rule the VTY config */
+	/* over rule the VTY config for MSC IP */
 	if (msc_ip)
 		bsc_nat_set_msc_ip(nat, msc_ip);
 
-- 
2.1.4




More information about the OpenBSC mailing list