From patchwork Sun Jan 10 13:14:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Yanitskiy X-Patchwork-Id: 565367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (unknown [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id CAE6A1402BD for ; Mon, 11 Jan 2016 00:14:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=hxlh9hz8; dkim-atps=neutral Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id D4082AFD0; Sun, 10 Jan 2016 13:14:48 +0000 (UTC) X-Original-To: baseband-devel@lists.osmocom.org Delivered-To: baseband-devel@lists.osmocom.org Received: from mail-lb0-x242.google.com (mail-lb0-x242.google.com [IPv6:2a00:1450:4010:c04::242]) by lists.osmocom.org (Postfix) with ESMTP id A731BAFBB for ; Sun, 10 Jan 2016 13:14:46 +0000 (UTC) Received: by mail-lb0-x242.google.com with SMTP id jk7so19950594lbc.1 for ; Sun, 10 Jan 2016 05:14:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=6JVEFQEvADUgJjy3dvKAz2pFvCB6YqD66RlgV9cYDcs=; b=hxlh9hz8fPlPWRixHg9LEs9zcv0uqdtOwn523S4TQ+tYcPACnXB9o0idm6C48AIsCS fwl+/2oX3m8IQ/PyATlbam6m5D9q8muQ5QFOfKZ0v9g++Pn5/2h4PCX4yg9rO3KxApco rthVLPAPQ/nmdJAFYUTDkBJMr9xflh67HGOYpqLMyjzK2T6QTBSNsDwPprOKiSoq2ZYs I/4mJtmxgASztB1b1UTHFDDnl/p+fwh94redxbM+C6kuSF7EYo8yCoegSyvr76ODhsym N5918mpTm1mC1Z3NAtgr2EcUtBBTnEIIyJ/EJg56k9yUDWEL7wXFQ1FqNeoT8Ze0D6KH WPbA== X-Received: by 10.112.161.33 with SMTP id xp1mr44007334lbb.141.1452431686606; Sun, 10 Jan 2016 05:14:46 -0800 (PST) Received: from DELL.lan ([212.164.216.34]) by smtp.gmail.com with ESMTPSA id 34sm14306903lfs.25.2016.01.10.05.14.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 Jan 2016 05:14:46 -0800 (PST) From: Vadim Yanitskiy To: baseband-devel@lists.osmocom.org Subject: [PATCH 1/2] Fix for "Added runtime selection of gps device" Date: Sun, 10 Jan 2016 19:14:17 +0600 Message-Id: <1452431658-13570-1-git-send-email-axilirator@gmail.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-BeenThere: baseband-devel@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OsmocomBB - open source GSM baseband firmware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?=D0=AF=D0=BD=D0=B8=D1=86=D0=BA=D0=B8=D0=B9=20=D0=92=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC?= , tnt@246tNt.com Errors-To: baseband-devel-bounces@lists.osmocom.org Sender: "baseband-devel" From: Яницкий Ва дим The 'gps host HOST:PORT' line in the config file now is generated correctly. So that it is parsed correctly when loading the config on next startup. Also the gpsd port now is parsed as it should without a colon. --- src/host/layer23/src/mobile/vty_interface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 5782a17..73aaa78 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1075,7 +1075,7 @@ DEFUN(cfg_gps_host, cfg_gps_host_cmd, "gps host HOST:PORT", if (colon != NULL) { memcpy(g.gpsd_host, argv[0], colon - argv[0] - 1); g.gpsd_host[colon - argv[0]] = '\0'; - memcpy(g.gpsd_port, colon, strlen(colon)); + memcpy(g.gpsd_port, colon + 1, strlen(colon)); g.gpsd_port[strlen(colon)] = '\0'; } else { snprintf(g.gpsd_host, ARRAY_SIZE(g.gpsd_host), "%s", argv[0]); @@ -1499,8 +1499,7 @@ static int config_write(struct vty *vty) struct osmocom_ms *ms; #ifdef _HAVE_GPSD - vty_out(vty, "gpsd host %s%s", g.gpsd_host, VTY_NEWLINE); - vty_out(vty, "gpsd port %s%s", g.gpsd_port, VTY_NEWLINE); + vty_out(vty, "gps host %s:%s%s", g.gpsd_host, g.gpsd_port, VTY_NEWLINE); #endif vty_out(vty, "gps device %s%s", g.device, VTY_NEWLINE); if (g.baud)