From patchwork Tue Dec 18 17:43:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1015526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="et/q0Lew"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43K55z4Nt7z9s0n for ; Wed, 19 Dec 2018 04:45:42 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E1F78DA7; Tue, 18 Dec 2018 17:43:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 70810DA6 for ; Tue, 18 Dec 2018 17:43:26 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 27A1F890 for ; Tue, 18 Dec 2018 17:43:26 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id h3so8482943pfg.1 for ; Tue, 18 Dec 2018 09:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BdHKVKUsnaooAOzyllgrwghld1YmSheu7Dc6akV/QEA=; b=et/q0Lewk0SDjRDLQzf1qyEiVGv6sMjYBePIGWdHmfsprC2QCsBdEiRFy9ato6ojpI HqTckxC6GV7uyOOiJI/6QCfBlmWJSvtBvmOY7YzANRdPlOTYSNuxfZVBA5O6VIMLBb0F hNVn5evESjxLK9vNL8VIsAe0s6yArVqYs5NNo4rqBeNvLh8ukqwRTImjgxh+3TTgwPre Cf89ZaRY0OMkg4ZV1uyrAt7v1xNZfcRgm4D6FSI3vOvWVoMPs5twYn9ZecNdCpomIb4a Y5Sxcxa2xhkE6pdC2iEwFJg/feFoeIqjsoHeiHvtTfrPruu3KM+mFUNkIQqKJwiVefq4 RWxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BdHKVKUsnaooAOzyllgrwghld1YmSheu7Dc6akV/QEA=; b=h+G9TzJQ14PwT850vTEWZuazaVhlXAiXEGhaMhoBd/VuJWc+KQGFo3gA+AynwtgPyY /zbTUhp0BqV0Qn9w7KX/aKle/wFsVXN8eNRVi9UTIJpKcUDRXKezU7GM+mRzinclmfoF Dd2YpRz97P+Kh/ziPisN+pGDw/03gDP5xU/AoOPHGpNGK5I/czqwKvUwx3OOGGxac9vs flW0ojZFR9afqUo4UAoZa/A/JXd/ArZCmFISqdOutzacBu8GPgrEx1RLMUlCYru98HvL hfHJCAWdyRmbz6qaY8m1WyiQQhrqqzwC/lur+O3TCC/PfxJzPA+7xxsIyJwuHPp1Duhu 5TqA== X-Gm-Message-State: AA+aEWansnAADaB8joyl/L1rUjDLBcZ3/tW7RrsNKrd3Ff8f6KrxYAsk hGYDO3IfASS3l8Z4AjRQMthhD2d5 X-Google-Smtp-Source: AFSGD/WqvFpbEhc3troWXkdBjSULmhivdXk5kqE6xgGcFamJbcqELN4KwCSrehDySyBKMOrndHQRUQ== X-Received: by 2002:a62:44d8:: with SMTP id m85mr17729158pfi.164.1545155005187; Tue, 18 Dec 2018 09:43:25 -0800 (PST) Received: from gizo.domain ([97.115.152.49]) by smtp.gmail.com with ESMTPSA id r130sm35093554pfr.48.2018.12.18.09.43.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Dec 2018 09:43:24 -0800 (PST) From: Greg Rose To: dev@openvswitch.org Date: Tue, 18 Dec 2018 09:43:19 -0800 Message-Id: <1545154999-24653-1-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] Revert "datapath: Derive IP protocol number for IPv6 later frags" X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This reverts commit 2f748bf8016c ("datapath: Derive IP protocol...") This commit is causing some ipv6 fragmentation errors in some older kernels. Revert for now and then we can determine how to implement this patch with appropriate compatability layer changes to prevent errors on older kernels. CC: Yi-Hung Wei Signed-off-by: Greg Rose --- datapath/flow.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/datapath/flow.c b/datapath/flow.c index f685cf3..fadc074 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -254,18 +254,21 @@ static bool icmphdr_ok(struct sk_buff *skb) static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) { - unsigned short frag_off; - unsigned int payload_ofs = 0; unsigned int nh_ofs = skb_network_offset(skb); unsigned int nh_len; + int payload_ofs; struct ipv6hdr *nh; - int err, nexthdr, flags = 0; + uint8_t nexthdr; + __be16 frag_off; + int err; err = check_header(skb, nh_ofs + sizeof(*nh)); if (unlikely(err)) return err; nh = ipv6_hdr(skb); + nexthdr = nh->nexthdr; + payload_ofs = (u8 *)(nh + 1) - skb->data; key->ip.proto = NEXTHDR_NONE; key->ip.tos = ipv6_get_dsfield(nh); @@ -274,9 +277,10 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) key->ipv6.addr.src = nh->saddr; key->ipv6.addr.dst = nh->daddr; - nexthdr = ipv6_find_hdr(skb, &payload_ofs, -1, &frag_off, &flags); - if (flags & IP6_FH_F_FRAG) { - if (frag_off) + payload_ofs = ipv6_skip_exthdr(skb, payload_ofs, &nexthdr, &frag_off); + + if (frag_off) { + if (frag_off & htons(~0x7)) key->ip.frag = OVS_FRAG_TYPE_LATER; else key->ip.frag = OVS_FRAG_TYPE_FIRST; @@ -284,11 +288,11 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) key->ip.frag = OVS_FRAG_TYPE_NONE; } - /* Delayed handling of error in ipv6_find_hdr() as it - * always sets flags and frag_off to a valid value which may be + /* Delayed handling of error in ipv6_skip_exthdr() as it + * always sets frag_off to a valid value which may be * used to set key->ip.frag above. */ - if (unlikely(nexthdr < 0)) + if (unlikely(payload_ofs < 0)) return -EPROTO; nh_len = payload_ofs - nh_ofs;