From patchwork Fri Feb 15 09:00:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1042683 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="vRtf87yZ"; 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 4416gh5M9Hz9s7h for ; Fri, 15 Feb 2019 20:01:20 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0BEEEB49; Fri, 15 Feb 2019 09:00:32 +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 D6F70B14 for ; Fri, 15 Feb 2019 09:00:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D4A8D5E4 for ; Fri, 15 Feb 2019 09:00:28 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id k15so4638048pls.8 for ; Fri, 15 Feb 2019 01:00:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=LWMt1OXsUdVmgPoay/obGjRLjAyDeX7emtGQ5xDWdQg=; b=vRtf87yZ/mgykRyJC9Z5uygTuqt8w3rJTf1+K2+ejux+lbdvmZxiFxMX6Ch7jvYWsy 2vk+4+4VRD3VB2Ck9/XLRTZrBVi9ecVdarRta5NTFHdruH4gt++9dEJY2/a75DJAKeBZ pfHJACbG+P9DvHsrbm5yQcP3mqGoEDfRbN4RXXGqbfFeZVL6hx8oCzrTV/Km1MRCUwHG eJstawHASzuN1fC6E6m/GE3dvmjNLifkuyi2ur5mWfki6zYohU8k+WpkLi+58M9g4hAU ZF6ntiU4/ATeHL3t7hJmzOwugCkzuAXRw9FxdaW2UMxnJqbrHu5LWM+m5Dwzd5Gj5UHk DQLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=LWMt1OXsUdVmgPoay/obGjRLjAyDeX7emtGQ5xDWdQg=; b=luUmJZMkuWzTRrJF67JkPL9jo4PLoxdV3XTGCYzKwaQLbr4PMBnC7bIez9CKyz5jS0 QA4kJBg40xazJq0t0j+I2j8unXPLKd3WsP8KKvDvuFJ4s7QBgV/fE4QHj+4PCZR+O32r xOSTQbHejhNW4yqmYGZZOeyJJ2a0p8UYj+fBSuUbK1q7EcZ54k0JKB0OzpxUdqzqvpIw NglQ6D8SGphLTiEsL6unxZXgdYEnasrs2X0SZdI0S9g2opZBTjFLRsG2TX/2Xpy71eMX XZ8rhObRRjT6poENmZcPwvPGrCsFBXVirnenu95z303EINRe/QyE3CD44YS8yTaK3sqn frUg== X-Gm-Message-State: AHQUAubhZD2E/2bNpY5Yvfy/n/atF43rn/FJJOxaFuYZ/aOJtdKs//bg sUSwkaC2V1WAshtvcNaEu9M= X-Google-Smtp-Source: AHgI3IZao2HoYLwmgO6FZhVTA4mrNGajTj6Z4uuTkoDm0BLnnxhV40PyRPEMgH11dYkguhu+jZV4zg== X-Received: by 2002:a17:902:296a:: with SMTP id g97mr9117337plb.317.1550221228384; Fri, 15 Feb 2019 01:00:28 -0800 (PST) Received: from ubuntu.localdomain ([208.91.2.2]) by smtp.gmail.com with ESMTPSA id b2sm5313256pgg.87.2019.02.15.01.00.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Feb 2019 01:00:27 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Fri, 15 Feb 2019 01:00:15 -0800 Message-Id: <1550221215-87456-3-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550221215-87456-1-git-send-email-dlu998@gmail.com> References: <1550221215-87456-1-git-send-email-dlu998@gmail.com> 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 v1 3/3] ipf: Check minimum fragment against L3 size. 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 Fixes: 4ea96698f667 ("Userspace datapath: Add fragmentation handling.") Signed-off-by: Darrell Ball --- lib/ipf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ipf.c b/lib/ipf.c index ec7c889..c386b69 100644 --- a/lib/ipf.c +++ b/lib/ipf.c @@ -612,7 +612,7 @@ ipf_is_valid_v4_frag(struct ipf *ipf, struct dp_packet *pkt) uint32_t min_v4_frag_size_; atomic_read_relaxed(&ipf->min_v4_frag_size, &min_v4_frag_size_); bool lf = ipf_is_last_v4_frag(pkt); - if (OVS_UNLIKELY(!lf && dp_packet_size(pkt) < min_v4_frag_size_)) { + if (OVS_UNLIKELY(!lf && dp_packet_l3_size(pkt) < min_v4_frag_size_)) { ipf_count(ipf, false, IPF_NFRAGS_TOO_SMALL); goto invalid_pkt; } @@ -692,7 +692,7 @@ ipf_is_valid_v6_frag(struct ipf *ipf, struct dp_packet *pkt) atomic_read_relaxed(&ipf->min_v6_frag_size, &min_v6_frag_size_); bool lf = ipf_is_last_v6_frag(ip6f_offlg); - if (OVS_UNLIKELY(!lf && dp_packet_size(pkt) < min_v6_frag_size_)) { + if (OVS_UNLIKELY(!lf && dp_packet_l3_size(pkt) < min_v6_frag_size_)) { ipf_count(ipf, true, IPF_NFRAGS_TOO_SMALL); goto invalid_pkt; }