From patchwork Wed Mar 26 21:44:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Willmann X-Patchwork-Id: 334117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [IPv6:2001:780:45:1d:225:90ff:fe52:c662]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9C8B914008D for ; Thu, 27 Mar 2014 08:49:24 +1100 (EST) Received: from localhost ([127.0.0.1] helo=ganesha.gnumonks.org) by ganesha.gnumonks.org with esmtp (Exim 4.72) (envelope-from ) id 1WSvhB-0006Ua-K7; Wed, 26 Mar 2014 22:49:13 +0100 Received: from isonoe.totalueberwachung.de ([2a01:198:210:100::1]) by ganesha.gnumonks.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WSvdf-0006QW-V6 for openbsc@lists.osmocom.org; Wed, 26 Mar 2014 22:45:37 +0100 Received: from adrastea.totalueberwachung.de (p5099b351.dip0.t-ipconnect.de [80.153.179.81]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by isonoe.totalueberwachung.de (Postfix) with ESMTPSA id E0AA860055; Wed, 26 Mar 2014 22:45:27 +0100 (CET) Received: by adrastea.totalueberwachung.de (Postfix, from userid 1000) id 70030220BC; Wed, 26 Mar 2014 22:45:25 +0100 (CET) From: Daniel Willmann To: OpenBSC Mailing List Subject: [FIX 1/2] fixup! sms: Fix gsm340_scts() to correctly decode absolute valid times. Date: Wed, 26 Mar 2014 22:44:42 +0100 Message-Id: <02248a12c3e51d7e5f8b9ae9e3c54569b706e31a.1395869732.git.daniel@totalueberwachung.de> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1395870283-30330-1-git-send-email-dwillmann@sysmocom.de> References: <1395870283-30330-1-git-send-email-dwillmann@sysmocom.de> X-Spam-Score: -0.0 (/) Cc: Daniel Willmann , Alexander Chemeris X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openbsc-bounces@lists.osmocom.org Errors-To: openbsc-bounces@lists.osmocom.org --- src/gsm/gsm0411_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index 197f2c3..3052dd7 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -120,8 +120,8 @@ time_t gsm340_scts(uint8_t *scts) /* according to gsm 03.40 time zone is "expressed in quarters of an hour" */ tz = *scts++; - ofs = gsm411_unbcdify(tz&0x7f) * 15*60; - if (tz&0x80) + ofs = gsm411_unbcdify(tz&0xf7) * 15*60; + if (tz&0x08) ofs = -ofs; /* mktime() doesn't take tm.tm_gmtoff into account. Instead, it fills this * field with the current timezone. Which means that the resulting time is