From patchwork Sun Nov 12 23:00:12 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: 118680 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1156796qgn; Sun, 12 Nov 2017 15:09:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMbdPJyYhFrcftsmayf9NUemQNshhraAiqLdVSnP6tkXIJFFTCGXXr8la+QbrYchYE3jjUR4 X-Received: by 10.55.26.90 with SMTP id a87mr10546649qka.184.1510528178346; Sun, 12 Nov 2017 15:09:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510528178; cv=none; d=google.com; s=arc-20160816; b=z7PT5z8bACxYX2e31fZ/KvQojNEtiXlnQig6GIh1XnuLBAaYLPou2noYJJEvxC27sU csLlGePg55hUtUYWJhFzoLQ4q263PgcqRhY/s/ipyr/ewWyOpKoCoXDhyKhTzeHi4FHt sZke7i7S3yZCOZb2kALGWqdXmogIkRFkqmgAsvWNu3wsjS9nuJCiEJFGHJqZjgIA+Oni YUv4YP1X7Z0V9slklIpF42Iz7dk01wXqfTy/hFzwuoklJgL2q98pyvE+6jGTFt1meY5N nY176oGLi3M5vWfp1hVrlYc6kNtmO98r7hV+n5dX3TMswc9Z5o7g4IVfD4qxfLDFmkRW pgGw== 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=/QYw8XW01SWhsTBm4ab5WtU3Qhtp3mVL+BmyFZ6RZI8=; b=p//AnkzWXcCINK+tkQ598VYd/U6yvv83xXnDo0puql5B3HfVyp1PuhS7YdL1cXa3sv bnXKOt+SA3+Qan8OHeuaAGFVYbDxuSdWh06zouPWx9xJRFbZN6FzaFvExCCSatJp/z+5 nsHg+x5F7AVxGvfWFZFjQaORNkVsIvPY8d7YsCzadho2q0aDpDtCZRn7ShVTU8hPUqQW mGwFbOILmzQ+FT9IyiyVgGe/6Wk0dfBdzT39B53paeY41aHtwrlIKaBjUiW/CYhK/rj4 IwsHGSGjM5qpMNL1iXJBzLKo+686eext+0MwhLVp9mxQ6rRDNwlD2H7j+k722NyxnEl6 b3CA== 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 g9si568742qtj.341.2017.11.12.15.09.38; Sun, 12 Nov 2017 15:09:38 -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 0C4F160B67; Sun, 12 Nov 2017 23:09:38 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 51C3260C11; Sun, 12 Nov 2017 23:01:32 +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 6780160C0B; Sun, 12 Nov 2017 23:01:09 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 6A65560A03 for ; Sun, 12 Nov 2017 23:00:25 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 584B6510D4AA for ; Mon, 13 Nov 2017 02:00:24 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 7vjVqq0qST-0O3Sco4W; Mon, 13 Nov 2017 02:00:24 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 3gEL078gGO-0NjWNgaU; Mon, 13 Nov 2017 02:00:23 +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: Mon, 13 Nov 2017 02:00:12 +0300 Message-Id: <1510527615-30536-16-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510527615-30536-1-git-send-email-odpbot@yandex.ru> References: <1510527615-30536-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 243 Subject: [lng-odp] [PATCH API-NEXT v13 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: 7261a0ce35cc31342937cb57dcc287aea0c59ede **/ 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 */