From patchwork Wed Feb 24 19:16:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neels Hofmeyr X-Patchwork-Id: 587605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 117DE140325 for ; Thu, 25 Feb 2016 06:17:06 +1100 (AEDT) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id AC7E71968D; Wed, 24 Feb 2016 19:17:04 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [IPv6:2001:bf0:c000::1:8]) by lists.osmocom.org (Postfix) with ESMTP id CF43819675 for ; Wed, 24 Feb 2016 19:17:03 +0000 (UTC) X-Envelope-From: nhofmeyr@sysmocom.de X-Envelope-To: Received: from localhost (ip3.vpn03b.berlin.freifunk.net [77.87.49.3] (may be forged)) (authenticated bits=0) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-4) with ESMTP id u1OJH29m030317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 24 Feb 2016 20:17:03 +0100 From: Neels Hofmeyr To: openbsc@lists.osmocom.org Subject: [PATCH 1/3] bsc_nat: fail if VTY telnet port cannot be bound, clarify comment Date: Wed, 24 Feb 2016 20:16:05 +0100 Message-Id: <1456341367-15394-2-git-send-email-nhofmeyr@sysmocom.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456341367-15394-1-git-send-email-nhofmeyr@sysmocom.de> References: <1456341367-15394-1-git-send-email-nhofmeyr@sysmocom.de> X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" --- openbsc/src/osmo-bsc_nat/bsc_nat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 41291d9..2d4f2a8 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1628,13 +1628,16 @@ int main(int argc, char **argv) osmo_stats_init(tall_bsc_ctx); /* init vty and parse */ - telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_BSC_NAT); + if (telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_BSC_NAT)) { + fprintf(stderr, "Creating VTY telnet line failed\n"); + return -5; + } if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) { fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file); return -3; } - /* over rule the VTY config */ + /* over rule the VTY config for MSC IP */ if (msc_ip) bsc_nat_set_msc_ip(nat, msc_ip);