From patchwork Thu Aug 24 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: 110896 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp5565757qge; Thu, 24 Aug 2017 05:07:12 -0700 (PDT) X-Received: by 10.55.192.84 with SMTP id o81mr8392906qki.22.1503576432040; Thu, 24 Aug 2017 05:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503576432; cv=none; d=google.com; s=arc-20160816; b=GDWHTm+aOcfJlNGg+Ryav7nqH1sTDjkHOVep8tL1AMM5OruUyRAz3J22SV+X8bck1G kXtej0XBOycrvgQbY71idb6eVNkxWjLr4bzBO38JUiLjo77bPmAxVtYx15Ehgi1gc9s5 hlChDHldzlrO7wzbNQlDm+UBaRSe640cSGEdjYNG7Qm/IUOfRUGR3j2O5iw1cmCdM0ez GhN3ek5SyLSTwxXc6XVOOw+hQbNgdXEXnW0t7NveByIIda/J5OQEB+Lk6rC/3fKxau4I l9V3Zcnj79KCTfdEB6BXs8bOJnkEvfBIMaL9mk1mZM6ZtAC0WGEkAj//3qUhB9bmjLWB 57Kg== 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=8D7RGjMO0Ka+7MueOma/s7tqJ1HXrMX1lWWBveMRcac=; b=HT3HEPJompFzpDZee5lxek7Gt18MKZj4X42yaTJ1+DT/CA0fj/700mlrck5t/rqCtW nowLUZR2fQ3RzF/XPLKQ4NJYQvf3AAQxtg1eYcLJ+n31NJ3updSGa9YDWC3UbeOU0o6C obP//obczc4nYpLl3BrxFHi9rWkCW9CjTEC1JCweWBiO5Yh7kcAcsUHZCe7BRUog+25u uF6AHlrsuwPTfkAmAEmKMABq1LCX2fym1/Zf+Jpub0Yb9+ddm4dhNjg6bhSFKXy4b51V zjjbUHkwso9OmuxpXNHNNR74CS8RzJq3QLjutuTU20yfxLxYjaaAHuov4kVFzrLVROfl Cj/w== 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 l6si3607596qtd.503.2017.08.24.05.07.11; Thu, 24 Aug 2017 05:07: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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id A031364490; Thu, 24 Aug 2017 12:07:11 +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=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 E7C43644C1; Thu, 24 Aug 2017 12:01:59 +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 098D964464; Thu, 24 Aug 2017 12:01:33 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id E55FB644BC for ; Thu, 24 Aug 2017 12:00:41 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 80417510499E for ; Thu, 24 Aug 2017 15:00:40 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id TxIDzPn4pO-0e38pLJW; Thu, 24 Aug 2017 15:00:40 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id u96GvWqCzR-0eDCm8Z2; Thu, 24 Aug 2017 15:00:40 +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: Thu, 24 Aug 2017 15:00:20 +0300 Message-Id: <1503576024-15965-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503576024-15965-1-git-send-email-odpbot@yandex.ru> References: <1503576024-15965-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v12 4/8] 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: 859293ad9b3c862264bb0fbfe8e7037b5e04d084 ** Merge commit sha: 3c4b4ab58168f2d1ffc93503027bbb5a5d2847d8 **/ 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 2b34a753..0fc391ab 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 432e91da..f896612e 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2405,6 +2405,10 @@ int packet_parse_common(packet_parser_t *prs, const uint8_t *ptr, 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;