From patchwork Fri Jul 8 08:14:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Forrest Shi X-Patchwork-Id: 71652 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp326533qgy; Fri, 8 Jul 2016 01:25:12 -0700 (PDT) X-Received: by 10.55.8.2 with SMTP id 2mr5946891qki.122.1467966312507; Fri, 08 Jul 2016 01:25:12 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b9si1310011qtb.136.2016.07.08.01.25.09; Fri, 08 Jul 2016 01:25:12 -0700 (PDT) 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D432168674; Fri, 8 Jul 2016 08:25:09 +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=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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 73D1E6863B; Fri, 8 Jul 2016 08:25:06 +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 06BB36866B; Fri, 8 Jul 2016 08:25:04 +0000 (UTC) Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0058.outbound.protection.outlook.com [104.47.37.58]) by lists.linaro.org (Postfix) with ESMTPS id 1A9C96859C for ; Fri, 8 Jul 2016 08:25:03 +0000 (UTC) Received: from BN3PR0301CA0030.namprd03.prod.outlook.com (10.160.180.168) by BN3PR03MB1496.namprd03.prod.outlook.com (10.163.35.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.14; Fri, 8 Jul 2016 08:25:01 +0000 Received: from BL2FFO11OLC006.protection.gbl (2a01:111:f400:7c09::126) by BN3PR0301CA0030.outlook.office365.com (2a01:111:e400:4000::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Fri, 8 Jul 2016 08:25:01 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 192.88.168.50 as permitted sender) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC006.mail.protection.outlook.com (10.173.160.95) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Fri, 8 Jul 2016 08:25:01 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u688OwIH024315; Fri, 8 Jul 2016 01:24:59 -0700 From: To: Date: Fri, 8 Jul 2016 16:14:12 +0800 Message-ID: <1467965654-34734-1-git-send-email-forrest.shi@linaro.org> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131124399012456972; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(189002)(199003)(36756003)(77096005)(87936001)(6806005)(356003)(68736007)(229853001)(2351001)(92566002)(97736004)(110136002)(4326007)(86152002)(7846002)(48376002)(50466002)(305945005)(189998001)(11100500001)(2906002)(47776003)(5003940100001)(104016004)(586003)(50226002)(81166006)(50986999)(86362001)(2876002)(19580405001)(105596002)(106466001)(19580395003)(8936002)(33646002)(8676002)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB1496; H:tx30smr01.am.freescale.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC006; 1:4Lm2KQ8ox791sv/uF5L6Y2SJ0wvWc3ZUomcaCE5Roi37+MUHW2Yy2O3d2+6bpRXrs5fMBApD/63pYHupsEAUkUUqTW0+Mw4W+t7A/Gms4wxvyWRnZtupZB/I1/e/dG7Baf8hUoB97wiw5LFF5e5f1n7TEHH0EuSXp6Dp61ObLSgkT0amMr7JPJUGnwk25KAq9xT0u5UTAnT3D6GC0xdjNIVvNt5gcl2Yg8ETWc1kG/nofb+iFYAT1ts2yI4JTTmhl+PATeuXbG6IpP1ABBdSuwgDcEGX1pDcUtcrpB2KLkNBkWzgc0/q9KhMSa1RSi/qoQn+37oiNBp9fUKGIQnu2oPZ0BZ//tjRQuUSJKWbDKDMuArbZcUzQnFqIy9Dx7CRBOo2jgDAAdV5xiYVvAPMLRm4vfTaN9ZVyzaCa9EJZ6IzjeLZ8YYrsfIsbqscT4Pir8bzZcC3OKIJfLodSxdiQnQpiOxnc/ZECIzfS2THm4ACRZMertobpp6SJ7jH5vmO9SKKyeoajCxFiJ9prPvgX5cS06w5rAu9+AaAC0JWb8qYdXRr00W94zXTB7LCuLyqHxov0NIelVcvrIM4Pv9/rbC12id8OmIbgZ7RsyTkaNY= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: d104844d-b619-4d67-c8b2-08d3a7095afa X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1496; 2:e1RpPFJrQinIM+3neQb+M+jIpM4AO9TVeUHg1GwTVYskqYZdvUr4wejh5HqPUMmKoF8v1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ghLU5z+v4Gsnc6GY4pYONZW41Mdf5nG3A==; 4:qLW1WibBrgi4GL5UpT3A1IUZlnZHTgC2cADG+cpYZVBsnlTuTu8gK5NBxJDK08fuR6TQ2IA2zl7S63yXAkKj7iPMrsSCcrSXYiHF0ZFZq8Mrl7yN2zy47sjBmcWnWUbkCrqoeEDfY2Iv4xfYlfVFQW0+VStvKTQfNgBkuqejgVaWW96rfulJDzms3sSdPso/fPgizvfNesQyOXQPiFV0XCBu/Q3xowhYMNepI0LAD+Ucz7rnTQvvOArmdTiqBW2M3hCq7bA9pSDa20qidoId56dIlvJAKW0nTT9FrrdHgWrkgW+we1BumrnXMXlOJ4TFpZ7I+tod55uJs6bqMi4tqcdr0rci47nRyflqEpPadk9Gw3kbPakVJhbaJz/yOAcT50jqo3ufWn3SbiYrferRbQqipxugeWPSTpV386H8AFU04KoYXceUymO3Gm2Lfa2T59WFzNxu+hJTkzIA98LKAc3qOn1tMA+kIKgbrcRa4Z8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13015025)(13018025)(8121501046)(13017025)(5005006)(3002001)(10201501046)(6055026); SRVR:BN3PR03MB1496; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB1496; X-Forefront-PRVS: 0997523C40 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB1496; 23:xWE87EoHnh9masNRp7YGOBagnMWOpvasc3S84dSuD?= =?us-ascii?Q?+4iG/cf660QaKwyXOEgM3CspHwtZNKIEmfmLfJbLcoOvcvJsZra+2zQcwSo0?= =?us-ascii?Q?/11ExsN5IDJEBlrhgljMd+Yqkcv/x3I606mTs6nL/sD7MYHL1dwjY8k5/edF?= =?us-ascii?Q?XkURjnPX1bpg+Q/7akxqn4tqnS9bKfPgyddvGNt0uOs/NGc58KBUsVrlwTRt?= =?us-ascii?Q?s7ziw+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64pJ0FH5bbjmf0wxvEXpPnn6bvjFV9xx+QKyyhu2I9S1FIseO5ycdd8lZ7QzyqvJWm5xjC1+KjqT4+yn/ke8arwH+pVFD7XNCFJPmVWKzdu8GkK3XKODSixLjGmTzeOgPtZtJZ8FzPE3E7meQljaUq275Hu+8dQ+C2/q0f8xIP0NAkj+TnGFFWLOJYCDIcZL4SeFukUVy+iwp3P7EReMKmel2RSu5sVFKygFziVh0Mt0J2oRI2sCrAmjcB1JdTSXs1JTjHBVHgw=; 5:VTODyYDW7U1LD4nZqIv94y5aMI8YtlOmZWhu1wnyHORB/R1a5se0+D246nSUPyK5mDEDUUjbbNutRSRtlh4mf4sQXbnlpyNZBuF18MTA20LC/N6bcYbbwd9K6fllEHwNM731rfBRvMQq53yW+Ygcex1wfL8Lf/QPqL58g7TkhTI=; 24:excsBudFWF+2z7bINlfp08um9YVv0DXf7squE8cdQ9v9NRuIN6wjIdBFcdRHdsZV2VJtql8Ugw2nx0W4vpuwsSSCTfGqWLSZ3F2JaNEGBUE=; 7:VfBDLRpTUfrXk7qYjGKMe0t01XMkolV8jmn/MuDkBBpsq1pcP1ZT1YEVAEtlAyZcZJYbI2s1r2T/RAB1XsG4xRsUx+o1L0syAqPLHjn8/8bTTKS8Q5o5B4YjtfTfV6QpB1oQmvVZZ0P0p6/1fbm4puU8JX7E75bed8EAHyjOwpj5oHbSO1OkaX7OjZvgiN+7f+w9D5Tup98Y9lEw6puoeKefuhyJdR9GIZ6Hq3qN2yvTqQsUxixS1sOIxw1jQAXK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2016 08:25:01.0741 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1496 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH/API-NEXT 1/3] helper/ip: fix ip parsing endian issue 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Xuelin Shi The prototype says returning cpu endian value but implementation returns a little-endian value. Add conversion to cpu endian. Signed-off-by: Xuelin Shi --- helper/ip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.1.0.27.g96db324 diff --git a/helper/ip.c b/helper/ip.c index eb73e5a..e211001 100644 --- a/helper/ip.c +++ b/helper/ip.c @@ -12,6 +12,7 @@ int odph_ipv4_addr_parse(uint32_t *ip_addr, const char *str) { unsigned byte[ODPH_IPV4ADDR_LEN]; + uint32_t ipaddr_le; int i; memset(byte, 0, sizeof(byte)); @@ -24,7 +25,8 @@ int odph_ipv4_addr_parse(uint32_t *ip_addr, const char *str) if (byte[i] > 255) return -1; - *ip_addr = byte[0] << 24 | byte[1] << 16 | byte[2] << 8 | byte[3]; + ipaddr_le = byte[0] << 24 | byte[1] << 16 | byte[2] << 8 | byte[3]; + *ip_addr = odp_le_to_cpu_32(ipaddr_le); return 0; }