From patchwork Sun Nov 12 12:00:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 118658 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp689481qgn; Sun, 12 Nov 2017 04:18:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMauUB0/5G/MvcwD3+7otmiXOU6VE+rUVymVOLqGT1y5ENq2Tb/r/CTTybKjFU9s7cDtklKC X-Received: by 10.200.24.235 with SMTP id o40mr7576862qtk.91.1510489115540; Sun, 12 Nov 2017 04:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510489115; cv=none; d=google.com; s=arc-20160816; b=L+n3MLGls4C6qoC1IcG96tPhLfiS5DFt80Ue8iyI6sz/gC9M4dVY6SicEwr8FnY0e5 tb8hIntZZGv/GyUCwPuNxFkDCtPqYopWP1PrBerPxF3LEEtpl4vpoGTQ7NlQaCTiEKyH 4LrP9CnYGXCsAq27w71B6bfUpMf/CjETAtCXbZeIoiV0zPhsxjfsNCSn8SGp+1buOxcr tAs9Mf4rPrJC9gi7tKWNeYRELmq98olpKZWHqMgEF3tymE742Hbo+VPtJRdhS68s+BHd AioK8xO1lHJQPgktpE7gvlTDbXny7X2aqYOQK670mKp7mTG927bUGBOygzZm9qr+C2Bu ibFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=wpdKXjBVUkXDwCHvY9+o4NbljWxq+WX8alDz1LQheOY=; b=EvhxpLgcVINX7Wrr8MmUcG/0GWK67b9hwcpPGS5IATzBKS792wzB8B8r/OUJ08JKbN iAyeK69eboaw1zfdoSYCG/q575KDg7HEjZLaLa3iJtfMXdyrHRoH0Z6TGrLtTJbWVIyP ksBrZHnPJ9XHiil1qrwfg93/AQJcHJYowNZGzFiBSRluPKjMJ/YiP4kMji664bli23BF AVTPd+4FzdOLUm7iTEmJZhvmDI+5A21cVGsUwD5UsbrGRSV2IJ0meuJFT2+RRvxpCziJ rl4zIIcvXkyw/2NBo6RDa98CMAP2wKsB/fpSDkX44wt5KoSakaZf4gb1BKz0/aU5Gg5o xm3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p64si12824888qkc.266.2017.11.12.04.18.35; Sun, 12 Nov 2017 04:18:35 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 3B36960B65; Sun, 12 Nov 2017 12:18:35 +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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 658FE60C2F; Sun, 12 Nov 2017 12:02:42 +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 A4C7660ABB; Sun, 12 Nov 2017 12:02:14 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id A73A0606A4 for ; Sun, 12 Nov 2017 12:00:32 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 9CDC9180804E for ; Sun, 12 Nov 2017 15:00:31 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 3sBhJdQo0U-0Vg4drgM; Sun, 12 Nov 2017 15:00:31 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 3w91frotLT-0Vvm45NA; Sun, 12 Nov 2017 15:00:31 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Sun, 12 Nov 2017 15:00:20 +0300 Message-Id: <1510488023-21204-16-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510488023-21204-1-git-send-email-odpbot@yandex.ru> References: <1510488023-21204-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 243 Subject: [lng-odp] [PATCH API-NEXT v12 15/18] linux-gen: ipsec: correct frag_offset for tunneled packets 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: Dmitry Eremin-Solenikov Generated outer header should have frag_offset = 0, MF = 0. Change code accordingly. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 243 (lumag:ipsec-packet-impl-3) ** https://github.com/Linaro/odp/pull/243 ** Patch: https://github.com/Linaro/odp/pull/243.patch ** Base sha: a908a4dead95321e84d6a8a23de060051dcd8969 ** Merge commit sha: e8722a0cdda227e01e7d308573aec08112d3c5b0 **/ platform/linux-generic/odp_ipsec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 49bacae01..832c62c94 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -677,10 +677,10 @@ static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt, out_ip.id = odp_atomic_fetch_add_u32(&ipsec_sa->out.tun_hdr_id, 1); if (ipsec_sa->copy_df) - out_ip.frag_offset = ip->frag_offset; + out_ip.frag_offset = ip->frag_offset & 0x4000; else - out_ip.frag_offset = (ip->frag_offset & ~0x4000) | - (ipsec_sa->out.tun_df << 14); + out_ip.frag_offset = + ((uint16_t)ipsec_sa->out.tun_df) << 14; out_ip.ttl = ipsec_sa->out.tun_ttl; out_ip.proto = _ODP_IPV4; /* Will be filled later by packet checksum update */