From patchwork Mon Sep 25 22:00:24 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: 114198 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3119955qgf; Mon, 25 Sep 2017 15:20:23 -0700 (PDT) X-Google-Smtp-Source: AOwi7QB5ucgACnO4qb1+A29p6Vll7TL3I7pp3HKj84H3PDkNformIkq98HKkOTG4eQ+/vAyi+Z5p X-Received: by 10.107.27.149 with SMTP id b143mr10989223iob.2.1506378023593; Mon, 25 Sep 2017 15:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506378023; cv=none; d=google.com; s=arc-20160816; b=tq8qMe7sd66zh4gYLQ3yupXFskvu+As9oD+aV1UclLL9JorWdpwojILTGQombCzgTo JqryL+5Npw2LJ9KrVuLKQymlUqJ6dtgP6cE6MxkuQqOrwR6MExdXMclgb7xEjsrm0uVF g/epkO6vSlnS7OxM8PQv85SyqtMzzA7GROzsDqHmqpVnEyjWye0dAp/dRv+jg7Fkdrl0 fWQp6Mr3R+QZbucw4xQMVTfSkFwbw3xPTw+z08M6uXAQqVhftQp65pPA1QuISo05psfW TqbFPrdF2S4dDhrt/Ri7EhyE1BlSx4PvWiflwrVcQ1BAKMHUvWFkfKyBdyaTLBOvTxUt Hhew== 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=WNBKIPG05D3AYWRFZK7w2mBD2SLVzTFy2cxKUmhxoIU=; b=D6jOGU+oxDBB4o0JIDtxgwo3R/fi6WeQCADtEjwLR46K5/pFjrbKUYoZRdQa/hkv/P 9d4ZFReZQ1HLJvDgmnPEUtrkFFaKbysnSQ9xOA64XMTmvRO7vrVbeNJ05a+G+VbuXFcS rbRQx2H5lEbCqD5cE9L7sLCXge5nyN+M0TRIY0cSD538nlKmNc9WOumyz+NifmSr3Xjg oTl8wp/E8jS8sl3QuVC7dqIZy0NOeGSMHolIGhRtylpzBFPvXXQZWyqEUysvxP1gwIxk 6zjbOuG42wy9dNcJgR0OjzkzA++LqlA/ejojqS16geaztHU+VhXcfC2Nh2+DvjuQRRKh pC7w== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j141si6112349ioe.277.2017.09.25.15.20.23; Mon, 25 Sep 2017 15:20:23 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 18B4660CDE; Mon, 25 Sep 2017 22:20:23 +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,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 348ED60D2C; Mon, 25 Sep 2017 22:04:11 +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 8092360A4A; Mon, 25 Sep 2017 22:04:02 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 5B88B60A4A for ; Mon, 25 Sep 2017 22:01:35 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward104p.mail.yandex.net (Yandex) with ESMTP id AB444180D38 for ; Tue, 26 Sep 2017 01:01:28 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id D2sFigKpAZ-1SjucAWT; Tue, 26 Sep 2017 01:01:28 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id y0gxWEywlF-1S4mm8qY; Tue, 26 Sep 2017 01:01:28 +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: Tue, 26 Sep 2017 01:00:24 +0300 Message-Id: <1506376827-27848-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506376827-27848-1-git-send-email-odpbot@yandex.ru> References: <1506376827-27848-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v19 6/9] linux-gen: packet: add support for IP-in-IP (RFC 2003) encap 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 Don't barf on IP-in-IP packets parsing, just ignore L4 (=L3) header. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 81 (lumag:ipsec-packet-impl-2) ** https://github.com/Linaro/odp/pull/81 ** Patch: https://github.com/Linaro/odp/pull/81.patch ** Base sha: 13322ca632f8ffba292bec058e597719bc54142d ** Merge commit sha: 04f37d8f29d26df3744151a85a19ef9b55b3d1f7 **/ platform/linux-generic/include/protocols/ip.h | 1 + platform/linux-generic/odp_packet.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/platform/linux-generic/include/protocols/ip.h b/platform/linux-generic/include/protocols/ip.h index 2b34a753f..0fc391abe 100644 --- a/platform/linux-generic/include/protocols/ip.h +++ b/platform/linux-generic/include/protocols/ip.h @@ -158,6 +158,7 @@ typedef struct ODP_PACKED { * @{*/ #define _ODP_IPPROTO_HOPOPTS 0x00 /**< IPv6 hop-by-hop options */ #define _ODP_IPPROTO_ICMPv4 0x01 /**< Internet Control Message Protocol (1) */ +#define _ODP_IPPROTO_IPIP 0x04 /**< IP Encapsulation within IP (4) */ #define _ODP_IPPROTO_TCP 0x06 /**< Transmission Control Protocol (6) */ #define _ODP_IPPROTO_UDP 0x11 /**< User Datagram Protocol (17) */ #define _ODP_IPPROTO_ROUTE 0x2B /**< IPv6 Routing header (43) */ diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 2208614c6..cc8af211e 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2062,6 +2062,10 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, prs->input_flags.icmp = 1; break; + case _ODP_IPPROTO_IPIP: + /* Do nothing */ + break; + case _ODP_IPPROTO_TCP: if (odp_unlikely(offset + _ODP_TCPHDR_LEN > seg_len)) return -1;