From patchwork Thu Dec 10 14:13:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 58208 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp517322lbb; Thu, 10 Dec 2015 06:13:52 -0800 (PST) X-Received: by 10.140.138.69 with SMTP id 66mr7146659qhk.18.1449756832399; Thu, 10 Dec 2015 06:13:52 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id t50si14983269qge.54.2015.12.10.06.13.51; Thu, 10 Dec 2015 06:13:52 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id DF3D66195C; Thu, 10 Dec 2015 14:13:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2EB9E618CD; Thu, 10 Dec 2015 14:13:43 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 3F4A7618D7; Thu, 10 Dec 2015 14:13:38 +0000 (UTC) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by lists.linaro.org (Postfix) with ESMTPS id 939C061814 for ; Thu, 10 Dec 2015 14:13:33 +0000 (UTC) Received: by padhk6 with SMTP id hk6so8202307pad.2 for ; Thu, 10 Dec 2015 06:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=lpPySaWNeZhQCBMLjIT7qT+Exts1Pg3Yo/ipLA8d4+Q=; b=BGYSNfHpTC5YO6CDAvqjOeyzJamjOoNMqPQJ5mML6HpQ9RGZ5YahrCywgTkheQ32No UE+/QvJaOMY405JnXMLAwVamQPAHtIfI/sLT6uo/2oPDCipSPkeInP/ecnTtl4AWnN0K HQlJuoIWFkTpE2QpF1GHXeGizM8a7+Uuzc/4WSPz5rnXaurtWOrgkVEetMD2VG/8SXHH nJxiFEKjAVodlore/t9rgOJRfL+gCygaydZdQ8bXyd2NY0T3ri3vRSaYv3nIbxQWqSuL /T9nZNkMKFkrFQU1sXL7yu99h0CWGEeVOc2kYIsc+QSKEKQUYi1D/dWDh/ryd8GlaQ05 5D4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lpPySaWNeZhQCBMLjIT7qT+Exts1Pg3Yo/ipLA8d4+Q=; b=DjUhj8kcwyFjQNat2WkghnD4qx28QwWndelQKJZ2LDye9LWka4SgFcm65rAGVs0ls9 DsMrIuawuO2xGAvvM3gKxCCDh0NdZjywf8VkBpBMPTkpt7vKTuF0hykdzii+sukulTaP JvFyjGQiiH6ngGjT/SR0k0lBxDmD8H8JOGI2gWk/GbYOs/q6esT9+8ZjhLEL28Pa0o5A NYARWPuxZop6J/hxlsJ94W4gIvbDuneK3nhbuAjLpWQueDe5tJaj9K6s3kQdux2ekP1J InMh+NqX/m0rCJc4mNQeVbhgBilN37rgbu/3uhg9yQxV7xW83m7PKrt2arSeh9YVBIQ9 L/cw== X-Gm-Message-State: ALoCoQm9U2mmVfMqSIxH4XcN9z9RQVNQnDKWQaf70t8WFZPRUqMDe5UO9oGZuy8EDhZU7wVBJfzwgKBbxRYS6rM9j/wGe4P0sw== X-Received: by 10.66.253.71 with SMTP id zy7mr16780233pac.20.1449756812856; Thu, 10 Dec 2015 06:13:32 -0800 (PST) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id dg1sm19265820pad.18.2015.12.10.06.13.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Dec 2015 06:13:32 -0800 (PST) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Thu, 10 Dec 2015 19:43:20 +0530 Message-Id: <1449756800-10730-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] example: classifier: fix ipv4 address input format X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Fixes ipv4 address input format issue. Signed-off-by: Balasubramanian Manoharan Reviewed-by: Bill Fischofer --- example/classifier/odp_classifier.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 2ecf733..0da07e7 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -167,9 +167,8 @@ int parse_ipv4_addr(const char *ipaddress, uint64_t *addr) uint32_t b[4]; int converted; - converted = sscanf(ipaddress, "%" SCNx32 ".%" SCNx32 - ".%" SCNx32 ".%" SCNx32, - &b[3], &b[2], &b[1], &b[0]); + converted = sscanf(ipaddress, "%d.%d.%d.%d", + &b[3], &b[2], &b[1], &b[0]); if (4 != converted) return -1;