diff mbox

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

Message ID 201602240257.u1O2vnjV010464@einhorn.in-berlin.de
State Superseded
Headers show

Commit Message

Neels Hofmeyr Feb. 23, 2016, 4:57 p.m. UTC
---
 openbsc/src/osmo-bsc_nat/bsc_nat.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox

Patch

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);