From patchwork Mon Jul 31 21:00:21 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: 109048 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp664667qge; Mon, 31 Jul 2017 14:04:41 -0700 (PDT) X-Received: by 10.55.31.76 with SMTP id f73mr22731854qkf.85.1501535081551; Mon, 31 Jul 2017 14:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501535081; cv=none; d=google.com; s=arc-20160816; b=op2GvHrd2m05eDiJT2df2jSsudn3Lzv0ld8pw01Fv4YO/1IyEm5GInieP+3Q7hR2u2 zO/QR0hT/4NXw+RCywJd1/YFlLGzkWsZbFc16xULNY9ve4mR0GArLS+1mAMcxXDELzvv OVFxvMq7sjQ5sp5gCn8Or+jgHtejI3UZDsQxhniLSow/BYW4s5ef9xui90rzlTDwWuYU bbWpEJ+MQxUm/bRVlsNDkP/JDQpI0rywvD66lNODmhx9EYtny+TXRYOHsV4+QSc+dl9U /hbno1fqUkRXCO17BxmPlbMq5TdWjpTd4QGBNBOGvi6Kc0zICPqkXh1cqaaJ/C5I6Brq dOhQ== 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=KQvttfIp6+29pjh+WxUUcKEr8VmU+2vz+LQYIidJiqg=; b=tvhV8Bkkvf7hMhRWPBf57/bi0QeV9mf4D8VVJw4+5UH1kYrAyDxFZcFVh2Iuxc/iO2 1ZT3kJFbskHnU8orVQ2nMaNpuVoEKNjT3hP7t0ze1MDheZwKBzr9Rh4pxt+o+msDO2hl X0l8OssakTVzZYGLepsDDp80sOg8lyQtDA6rYfzDx0YNxvV7zNq6WFhOKGB93LdBQaj2 bOLxnQuYeqqtv9Ov23RZmItjSxMo5VQI5eQv8ronVWfws8vdNmkUEucAxHLQ38hHPTo3 79BJ+oLAWhFf/kUuaLq0ckSBKOgHuv/UILwTYheYU+ssWu6KzwmtHqP6a/5nu9kY9bUz VKUg== 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 p33si21174217qtd.279.2017.07.31.14.04.41; Mon, 31 Jul 2017 14:04:41 -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 2E6D765C44; Mon, 31 Jul 2017 21:04:41 +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 EBE7B644D8; Mon, 31 Jul 2017 21:01:56 +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 1D33565C35; Mon, 31 Jul 2017 21:01:44 +0000 (UTC) Received: from forward3j.cmail.yandex.net (forward3j.cmail.yandex.net [5.255.227.21]) by lists.linaro.org (Postfix) with ESMTPS id 6E847644D1 for ; Mon, 31 Jul 2017 21:00:39 +0000 (UTC) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::28]) by forward3j.cmail.yandex.net (Yandex) with ESMTP id 73D6F206A6 for ; Tue, 1 Aug 2017 00:00:38 +0300 (MSK) Received: from smtp4o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id 42EE96C00FD2 for ; Tue, 1 Aug 2017 00:00:37 +0300 (MSK) Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 71jwvRBPdT-0brWZiRO; Tue, 01 Aug 2017 00:00:37 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 1 Aug 2017 00:00:21 +0300 Message-Id: <1501534825-20687-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501534825-20687-1-git-send-email-odpbot@yandex.ru> References: <1501534825-20687-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v8 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: c16f1363303cd5fc11324acbc4dfebe0a9680a41 ** Merge commit sha: 0200589a1a6a31f0d0a93454a68bffbfe56d325c **/ 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 1971fdc0..4b8d0856 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2033,6 +2033,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;