From patchwork Wed Oct 18 14:00:17 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: 116306 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6113801qgn; Wed, 18 Oct 2017 07:11:21 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Tc4BqDsSW4ce5mQWLG5MbM8/CLf39hxbagYhexfhAcMDMaLAtkVBAOIbtD/2kGMUQpxfJp X-Received: by 10.36.225.133 with SMTP id n127mr10077609ith.12.1508335881640; Wed, 18 Oct 2017 07:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508335881; cv=none; d=google.com; s=arc-20160816; b=cVhE0P7w2H4kzymLQSektfrY/HJcW3iobhMZPX1HhdjHtCxNcb4VOEfbExD9v4dOm0 U9DY2mP7FSmbuHJ6d8GtbNbMLpYEasUBUhB2paxCN0BsgGXnm4QkEtU/rqTmtezyFIC5 u9Ysck7zbU1+lqvapjWOWssf7Kxhv3TkTMcW46esZDrb4WFDYYq6L7yOmfb7InjVvlf1 xwb2NqZgy+KRYdXFidaySRB3aTG+xlMP9EiwldE6JtaJNBgBwwwmEQsmCzemjxVGz+aW XAYWTRm4EMFt/Pq1W32BZf23TB3Ah0Xq4RlCRaYHKVfeTwNlhZUBSoYiWM9vaP4qR1uF lhpw== 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=9qY1n6qymCuD+b5AcfKULM6CXLkvq9+n1nMz/lQOZsY=; b=hmFGd9gA6ylrsIBn022MeXpKluhKPuQ64KQuFP8SMQn6Rnnw0lXKApjmjvZ0RXS2Wy 75ocQFk3mThqSlXhksa0gjw8Vvb8i/dy4l7PygoTbeX6vXiKrEVHdE5Nn9VdlA9zQl7F nhNL+t0JvsL2WfbFuFsTKvNW/rL5wLF8sDkVIFQRIHkrvpBeXQyZl8JYAh/oONRmH5P2 xZ9JHEA5snCgDsfEKcBND8TqbGEikEgjYCT8zUDpGnaHhrg2UW1x1Ohx3cs+t5uJbihM 6qXG3HuqL9DP2q4kwAVhHX4ZVmmWIH8lvCI+pdBeLiBs75Ixx2CSf/zsjbUExLEiKzbU kpig== 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 r2si9393718ioa.54.2017.10.18.07.11.21; Wed, 18 Oct 2017 07:11:21 -0700 (PDT) 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 243746296C; Wed, 18 Oct 2017 14:11:21 +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 93EFF62971; Wed, 18 Oct 2017 14:01:28 +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 8D9D0628DC; Wed, 18 Oct 2017 14:00:50 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 353FA622C6 for ; Wed, 18 Oct 2017 14:00:45 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 8BA811342925 for ; Wed, 18 Oct 2017 17:00:43 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Tu12uOrhIY-0bkG1i6p; Wed, 18 Oct 2017 17:00:37 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ELMppi1EYu-0aju7U4i; Wed, 18 Oct 2017 17:00:36 +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: Wed, 18 Oct 2017 17:00:17 +0300 Message-Id: <1508335223-15608-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508335223-15608-1-git-send-email-odpbot@yandex.ru> References: <1508335223-15608-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v20 4/10] 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: edca8cd1e55898826f79383b689c2c4bd2c28b3a ** Merge commit sha: 750318196a0c07a634c4755e4da9131a9f11f6f1 **/ 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 d94718dd7..0f6e1b79d 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2034,6 +2034,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;