From patchwork Mon Sep 18 11:00:22 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: 112904 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3533960qgf; Mon, 18 Sep 2017 04:12:49 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD1AtM/RmMXvTs0ZMOvlGwEMTY0fjV/dZ4ICGYjXgNsB8bIi9HxL2JOjwKtB46Tp/gzCdVl X-Received: by 10.107.169.208 with SMTP id f77mr20389708ioj.191.1505733169038; Mon, 18 Sep 2017 04:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505733169; cv=none; d=google.com; s=arc-20160816; b=F+Ud7wucHUdWCvZXgeeqOlXrfCubXjIC9hjjm/XfKprgZvlB8USSEtS7C0i/ovJcEG oc3n84vS9Vd/EfdfT5XPXuftmKcKgL3xpTv132Y9Yx8IwAf7e0674MjdOfI7R0x7/H3L sxSt0ISYDens5KLGctfsL8FXrRUVpOt5ELUOBYm7JMIDu/zvWutsi1m/CjYT0cXj2D+C X/7qRvPrNyZRrfzq2MsAaSV0NmQoIa2ZlONBy8XwTYNkphsEC/Y7pEsix9SYiuWyWTJS u+RwYbJK2cBRjwZjJqjnvBJVBTYtZP6+HM4cuIoN2xxbSkxio/5u7rLeuLVdwQEF/awS ffHw== 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=8bV1+tgqybYviGcOX2qzqUmITmq+plq+vHi01hnbBKg=; b=eXeN3Jq3EYwg5TmNBKvJnd//v+uQ3c3iiAoEcb5k+qEMshf2huc1Onax4iqHnYn0AP tSZWCGVEoTwsZAZpQVmoU0PfVVfk9oiBVlS1HK8k4x047xv1GQB+BQNXrzb19mx76Kig Q859aucrz+n95gggPkHdvr7iWrOTHkWjMJsw8U0REHR4axXiIeymsoGzNIFQGTkC5hp5 LgqmJGSVdJ/QSr0yUtGKx0fBPgBPvXSnykpg/INNIEPwmQbkuaSztmRyQjTNMTW7jLxS rm4w6WV8Utj4wGj09VLQ5VZokk/qfg4szDNMjY8d+9WLPqv4M15ILmKvTuUPL1T3miUJ 1aoQ== 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 83si4323977itf.105.2017.09.18.04.12.48; Mon, 18 Sep 2017 04:12:48 -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 7105E62CE2; Mon, 18 Sep 2017 11:12:48 +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 64B4960D43; Mon, 18 Sep 2017 11:02:29 +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 4F1A860D6E; Mon, 18 Sep 2017 11:02:17 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 564C460D58 for ; Mon, 18 Sep 2017 11:00:38 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward105p.mail.yandex.net (Yandex) with ESMTP id DD27A4082A83 for ; Mon, 18 Sep 2017 14:00:36 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xdQwQmoJaX-0aPGnn6H; Mon, 18 Sep 2017 14:00:36 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Q0MY2IdQni-0aLur5N4; Mon, 18 Sep 2017 14: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: Mon, 18 Sep 2017 14:00:22 +0300 Message-Id: <1505732425-16969-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505732425-16969-1-git-send-email-odpbot@yandex.ru> References: <1505732425-16969-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v18 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: e344e4364f771f32b86d822d0c447770588fe65d ** Merge commit sha: a16b0229af913f1d1f74b7d97bc0ecf8c7542e04 **/ 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 befcfdd23..286ab4138 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2059,6 +2059,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;