From patchwork Tue Sep 5 10:07:03 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: 111658 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp2654516qge; Tue, 5 Sep 2017 03:41:06 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4SxHuJNJWq5c1N+W0hm/iaFZxQv8ydj+FNOCUgZCdLnI+W2KsoGlOed7lxh2/1XI3ulJsQ X-Received: by 10.200.33.206 with SMTP id 14mr5088569qtz.182.1504608066739; Tue, 05 Sep 2017 03:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504608066; cv=none; d=google.com; s=arc-20160816; b=Y5W06kT1VzE3VnWtw86ny7YykJdl+lIp6vJ1cDDwLjx290Vp0q8+LEdke9l48YHjKZ l82qjg5nS4cXy3C5o8PKzghqZm5xvb6GaW9jkXhXcRDza6lsSl9JnHEeO3AhkXcI4TZ+ jMQ+jCrfaKEqLfvb0Bqsxp29kAJzZOECq9ktDdAhZdmJJxtJEsLwxCG3aNhb5udHhNg+ ntWhJFRQYg8tMvAHyJcPOjVHrUnHOnc646SGZ1l/Keuy7uDjCJ+eWebBcLYOmwSgnFpB AjFmLuepiYkFMDggwe+c+D4XyblQMbzur2cb2d8vXjKD8ZuwNa7RJKvl0D1sxKWinFdw pWKg== 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=iXgMEgPHYPnV5zCHEO4PCBkEDMyVBPboTc3b/6GSz4g=; b=CZD50CaxyIhmSN3G8ISrdVOSim3v5dzlF9/xCOmrFUL6nZpSAmhz5//o2KnP5S/i3d M9NTE1IDUGGcuzcbABHiM2ATbl86l412oUGLq9PmKDBUI5ZubnXxwtavuYOOtK1ilVXZ sa01U4r7tqZ7wMpMG/P7Ucv7NKyOZCSzinENvBvyeFiAY0l+kDUzoVPWD/Ubs/QT4rT2 twK6vPuG+UdtsE28+4NN5f38a2cSEMSByREV5sLB0cbVsJLpqrAzeYJzXJYKaC5IzLJ8 OgLO+fC6brA41LIMjM+xJaibvAG4o0xsu2QEdEqIhasbOiDzbCMwcEs4ipeBk+XQKsnp Kw0A== 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 e12si108514qkh.265.2017.09.05.03.41.06; Tue, 05 Sep 2017 03:41:06 -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 4345362B5D; Tue, 5 Sep 2017 10:41:06 +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 7D0AA635D3; Tue, 5 Sep 2017 10:12:25 +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 75EE862DB3; Tue, 5 Sep 2017 10:11:45 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id A4CFE60F34 for ; Tue, 5 Sep 2017 10:07:26 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward103p.mail.yandex.net (Yandex) with ESMTP id AE5742184A2F for ; Tue, 5 Sep 2017 13:07:24 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id MNsYDnAeDx-7OV03H1k; Tue, 05 Sep 2017 13:07:24 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7CWa9Tztus-7NeGYZ2s; Tue, 05 Sep 2017 13:07:24 +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: Tue, 5 Sep 2017 13:07:03 +0300 Message-Id: <1504606026-28181-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504606026-28181-1-git-send-email-odpbot@yandex.ru> References: <1504606026-28181-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v15 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: 91c0b58fc87ba0431241818758cea94438cd5498 ** Merge commit sha: 3ec7da960bd3d497e998f18cb30a2480296e7b6d **/ 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 1292d33e..4793fa12 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2385,6 +2385,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;