From patchwork Mon Jul 24 15:00:39 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: 108582 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp3950035obm; Mon, 24 Jul 2017 08:03:52 -0700 (PDT) X-Received: by 10.237.60.247 with SMTP id e52mr21630182qtf.106.1500908632284; Mon, 24 Jul 2017 08:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500908632; cv=none; d=google.com; s=arc-20160816; b=CxHjWs3j4+7xj1XoeAjaAysC7q91SQg0cCHYNgAehjSzqaxymN50Cnd7RRZYhFHLu7 tJmI8ePxKHcwNWXxVj05w6rPpcNDUhR3gd2MwJ8Uer4LyAOedYpYUlgZFuZoecvkjTth V2MCmAUOEQDiqHq4waj82JocgPy2pzZt25jaVkPXvfQniOnxyKV5JCARQhgfPf6XQp5a i+I3J4gz0kFnY0OVZb2t0oweBYWMWXCrI+nfsGJZ/YlzgYA3MW/+fw+oeZgBvnhx0oK2 Jd3ih0a5SC0xwXlh7R18MvFrKICcQzzjaXk1bg1OFv5XhnUkCrtnQmtiUJdZwy9m6VU2 neSw== 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=fCrvi8QDG0xXAg6b4fpzF93/ecCvRsV90CInnPrhl2w=; b=pLuW0m6HpC17/cVXroRuh+RZJgJ3CqI+Gj3RsuVQ6srwlvtKhSIoNnVU3NtqwaNW+N b7J7LfzecKrg88/a1Cbr6eSrJuZtGMoBeRPysXKAzBTFuPzsxGhL+O4mYQtm+o6+Jrve rqzKaGHseelyGFJfEovr35mFCPjcsxES/OZ1R+LSKGacD5p6baw2HtUSMrEhs0oysXLu 6kZdIGaqgFN/IC38FntcIjpYGedQ+C/z/0jMcTnPmkYRgvqj+ZRYPskp6Jgw+bE3cZsY MIkEXQETIQO3mx1oeHwZKCTUH6Cjw6P6jwgSwMGNcT6mCrbJKtTp+DRJK19wLidtK5X/ xCog== 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 m11si2489851qke.386.2017.07.24.08.03.51; Mon, 24 Jul 2017 08:03:52 -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 C814F64490; Mon, 24 Jul 2017 15:03:51 +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 0CE9D6449F; Mon, 24 Jul 2017 15:03:14 +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 302156449B; Mon, 24 Jul 2017 15:03:11 +0000 (UTC) Received: from forward2p.cmail.yandex.net (forward2p.cmail.yandex.net [77.88.31.17]) by lists.linaro.org (Postfix) with ESMTPS id B2842644A2 for ; Mon, 24 Jul 2017 15:02:06 +0000 (UTC) Received: from smtp1m.mail.yandex.net (smtp1m.mail.yandex.net [77.88.61.132]) by forward2p.cmail.yandex.net (Yandex) with ESMTP id C53E421166 for ; Mon, 24 Jul 2017 18:01:55 +0300 (MSK) Received: from smtp1m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1m.mail.yandex.net (Yandex) with ESMTP id A668C63C0AEA for ; Mon, 24 Jul 2017 18:01:55 +0300 (MSK) Received: by smtp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id j48yURuil2-1mqK6Z4K; Mon, 24 Jul 2017 18:01:48 +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: Mon, 24 Jul 2017 18:00:39 +0300 Message-Id: <1500908444-7531-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500908444-7531-1-git-send-email-odpbot@yandex.ru> References: <1500908444-7531-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v5 4/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: db7cc41aeb559dd296f3a6d8570aa10326a31d5e ** Merge commit sha: ba0b39db1fc90b24a3db1e85e00c2c485b235a47 **/ 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 092af84b..526d398f 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2080,6 +2080,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;