From patchwork Wed Feb 20 06:57:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1045154 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="SUs5WdnV"; 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 4447pY2HWpz9s2R for ; Wed, 20 Feb 2019 18:02:44 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 920C92497; Wed, 20 Feb 2019 07:02:41 +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 DF2A022FD for ; Wed, 20 Feb 2019 07:00:04 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 717D379 for ; Wed, 20 Feb 2019 07:00:04 +0000 (UTC) Received: by mail-pg1-f172.google.com with SMTP id q206so11393316pgq.4 for ; Tue, 19 Feb 2019 23:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=UGl0x3D2tnAMzqt0Hk9fwbdaK7cuCejUjn6uks1YvN0=; b=SUs5WdnVQEjqAY9ji4+ndWcjL0AEUoQHYbyNSJHuH2vD1nA+fz38PXg1hdTJ6JpOff kvP0Horm5NsW06qwoGQ29fbme3BdessTiemJai8kKdhZjoJUiIWMT+wlXI+BaQgxLDK9 ugWKZtOyieGbOMzQfv4oTvT712T3ZhNjNF0TwhspisdyNJFSxyOD1El51fQtceScPWVA m+VeZ3TrBUOcgd2P/2u8k/hn6SX56vU+yaALTN8FGDfvpEU78mbK7ZZJS7BKzSKkW8jE los2RZXKPLZR4vBQg0qbxrFBCZ1LfOM+Y0mGrX5ufdNlSW1l8BfpmQ9d2YV8JSQ1K9TO NQhg== 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; bh=UGl0x3D2tnAMzqt0Hk9fwbdaK7cuCejUjn6uks1YvN0=; b=gmMBROQ+AKHMJYU+KESL4mqJWDiUJo/Fkj+6yW8pAI9Bi/f7wnT2iQ8fO0kkx+X+Q6 /PjmHFi3M2J4+Tw/QeNMyUn6h8xk7za4Iqk9bl3tZQW+rTJzHDvLRs08p12OEfhZ38iC 6bzXMRa0N7t2+G/TnqgQ/CQKwFwSLq2FOHav9LuC0zRtlZDjdPDKdhIOwCMiRCNSI4uA jnI2zWfhxiCpLczpivnhqze975EB84lmad+6l69a0xn0dFe0yKveN61I02GoYdKBxV1/ rHMS3BNqSL3h1TmEYmeD/BNRTgjqBiM0jsDa+tktcnhTlV/sFZR6hRmIGGksNlo4JqjH ibTQ== X-Gm-Message-State: AHQUAuaxL5HIyp3v1b4YzbGAuhuMtfAZBAA6KRutTj6NBZWnarKLWjlA JOxPlshlW49wSXgjJ7LwPHA= X-Google-Smtp-Source: AHgI3IY5IpersL5Lie70zIeJinamDpU6IM2Q2YHkSHaA1TMv8D2CgJxc1nWSPHmibhAgzhLLPC2oPw== X-Received: by 2002:a62:57d7:: with SMTP id i84mr33743525pfj.125.1550646003682; Tue, 19 Feb 2019 23:00:03 -0800 (PST) Received: from ubuntu.localdomain (c-76-102-76-212.hsd1.ca.comcast.net. [76.102.76.212]) by smtp.gmail.com with ESMTPSA id x23sm43321773pfe.0.2019.02.19.23.00.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Feb 2019 23:00:02 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Tue, 19 Feb 2019 22:57:13 -0800 Message-Id: <1550645838-417-1-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.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 v2 1/6] ipf: Misc Cleanup. 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 Signed-off-by: Darrell Ball --- lib/ipf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ipf.c b/lib/ipf.c index df5196f..125a815 100644 --- a/lib/ipf.c +++ b/lib/ipf.c @@ -456,7 +456,7 @@ ipf_reassemble_v6_frags(struct ipf_list *ipf_list) int rest_len = frag_list[ipf_list->last_inuse_idx].end_data_byte - frag_list[1].start_data_byte + 1; - if (pl + rest_len > IPV4_PACKET_MAX_SIZE) { + if (pl + rest_len > IPV6_PACKET_MAX_DATA) { ipf_print_reass_packet( "Unsupported big reassembled v6 packet; v6 hdr:", l3); dp_packet_delete(pkt); @@ -530,8 +530,6 @@ ipf_list_state_transition(struct ipf *ipf, struct ipf_list *ipf_list, case IPF_LIST_STATE_LAST_SEEN: if (ff) { next_state = IPF_LIST_STATE_FIRST_LAST_SEEN; - } else if (lf) { - next_state = IPF_LIST_STATE_LAST_SEEN; } else { next_state = IPF_LIST_STATE_LAST_SEEN; } @@ -765,7 +763,7 @@ ipf_list_key_eq(const struct ipf_list_key *key1, static struct ipf_list * ipf_list_key_lookup(struct ipf *ipf, const struct ipf_list_key *key, uint32_t hash) - /* OVS_REQUIRES(ipf->ipf_lock) */ + OVS_REQUIRES(ipf->ipf_lock) { struct ipf_list *ipf_list; HMAP_FOR_EACH_WITH_HASH (ipf_list, node, hash, &ipf->frag_lists) { From patchwork Wed Feb 20 06:57:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1045155 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="pRp5Kzd4"; 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 4447qH3LPCz9s2R for ; Wed, 20 Feb 2019 18:03:23 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 759C32491; Wed, 20 Feb 2019 07:02:42 +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 67D0022FD for ; Wed, 20 Feb 2019 07:00:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2BD7379 for ; Wed, 20 Feb 2019 07:00:05 +0000 (UTC) Received: by mail-pg1-f169.google.com with SMTP id y1so11373229pgk.11 for ; Tue, 19 Feb 2019 23:00:05 -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=wNGCNctH9ykIHrzDBHn0D+xwdNnWPzLj4Gi183rCeOU=; b=pRp5Kzd45e3JBXp0ipTqYejrEFdVYMy1MQ03CgX4aP1gLlk40XTO9OV40Wn/OUMRM+ cWxavmXnnN/H/21e7CTAIzMGSKZ9p/W+AkcLxRZvqupDwznqRYQHW8D0xM5PgV8519o+ Ynxl5xa4vSULyszgka97GQv4Gfz0uRQUGuXo4RUCmqFMf2OmwhzxBXmXyH5bYkpcGLw2 2aeHieeVcs+2j2UFKlZHVOvhgjXn8n/7vd3mR8p6J5EXVajTJrPCQlSlXINQaKwBRwHL HVsLIv4RDGGq1cY5/173u3yw0pXqkydcrc4z717FXIwZirh6CspLVxjjfn0KhTDUDSBs c3yg== 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=wNGCNctH9ykIHrzDBHn0D+xwdNnWPzLj4Gi183rCeOU=; b=EEANhxsvoPP4s1X0TAZqwO3A3pmMLxvMtoiAeyFkegyH1tCVzDnGYU55iNEwLwq9II dNgGucm4s3xmiPmOmJvQOVBAYHelM9SF5MUDT17RBvxIDeqBP8QUyIQgs1ICX9b7LGKJ KSuCC5wj6ji1cPzRhX1mxOhK8HZTORU7cWtEv/CTfDiB84ttxp2X9vac93R+vX3760Y2 0CTELx9584/U9rA6umjMjjwGQeH914TaonQ5NIHRu9xyypRPaIuurOM0fSfgWjgGT8of MIpX7rf+X6fGHS29RFVpVQPrn/WlVYifj7b53SIpTufE0FpLahnaGSagLntMnmOezHYp zQVw== X-Gm-Message-State: AHQUAuYn+FPR6xrjvTLJ3hAKtTvKmyopgu5ifrPq2HLFh3xmXWqePxB1 EcIF+oeJstiM+SoB3jIow3wYh/3/ X-Google-Smtp-Source: AHgI3IagqTWLP6Bu5TXXOKOAAsnMuhVH+0dRUYYnnoA7v9XJXnkfuexmrMrlvYuc0Xm6fDzPzajbew== X-Received: by 2002:a62:3a89:: with SMTP id v9mr33297418pfj.26.1550646004783; Tue, 19 Feb 2019 23:00:04 -0800 (PST) Received: from ubuntu.localdomain (c-76-102-76-212.hsd1.ca.comcast.net. [76.102.76.212]) by smtp.gmail.com with ESMTPSA id x23sm43321773pfe.0.2019.02.19.23.00.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Feb 2019 23:00:04 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Tue, 19 Feb 2019 22:57:14 -0800 Message-Id: <1550645838-417-2-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550645838-417-1-git-send-email-dlu998@gmail.com> References: <1550645838-417-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 v2 2/6] ipf: Do not preallocate more than needed. 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 ipf_reassemble_v4_frags() and ipf_reassemble_v6_frags() are preallocating more than needed for the reassembled packet. Signed-off-by: Darrell Ball --- lib/ipf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ipf.c b/lib/ipf.c index 125a815..a4608af 100644 --- a/lib/ipf.c +++ b/lib/ipf.c @@ -420,15 +420,16 @@ ipf_reassemble_v4_frags(struct ipf_list *ipf_list) return NULL; } - dp_packet_prealloc_tailroom(pkt, len + rest_len); + dp_packet_prealloc_tailroom(pkt, rest_len); for (int i = 1; i <= ipf_list->last_inuse_idx; i++) { size_t add_len = frag_list[i].end_data_byte - frag_list[i].start_data_byte + 1; - len += add_len; const char *l4 = dp_packet_l4(frag_list[i].pkt); dp_packet_put(pkt, l4, add_len); } + + len += rest_len; l3 = dp_packet_l3(pkt); ovs_be16 new_ip_frag_off = l3->ip_frag_off & ~htons(IP_MORE_FRAGMENTS); l3->ip_csum = recalc_csum16(l3->ip_csum, l3->ip_frag_off, @@ -463,16 +464,16 @@ ipf_reassemble_v6_frags(struct ipf_list *ipf_list) return NULL; } - dp_packet_prealloc_tailroom(pkt, pl + rest_len); + dp_packet_prealloc_tailroom(pkt, rest_len); for (int i = 1; i <= ipf_list->last_inuse_idx; i++) { size_t add_len = frag_list[i].end_data_byte - frag_list[i].start_data_byte + 1; - pl += add_len; const char *l4 = dp_packet_l4(frag_list[i].pkt); dp_packet_put(pkt, l4, add_len); } + pl += rest_len; l3 = dp_packet_l3(pkt); uint8_t nw_proto = l3->ip6_nxt; From patchwork Wed Feb 20 06:57: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: 1045157 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="opTEolEM"; 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 4447r31X2Qz9s2R for ; Wed, 20 Feb 2019 18:04:03 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5ACDC24A5; Wed, 20 Feb 2019 07:02:43 +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 89EB322FD for ; Wed, 20 Feb 2019 07:00:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0220079 for ; Wed, 20 Feb 2019 07:00:06 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id q206so11393394pgq.4 for ; Tue, 19 Feb 2019 23:00:06 -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=GRkc/aE7bxQWfroaFbp5mDMhYOtco1/wqF3xUD9yM3k=; b=opTEolEM6cUCTHWq8ugnqGPYpYFSP7iC40HtVJtnhYfy2u+TgSPRh5MVNS6YdBTbCL 1ZtxD3Yb8Hat+zJYg53X4vSHZLEIhRBrlxL4Aj3l8GvawRK9n29n9bIwx5I1d82aKL86 uYHEMof4yyW18jp3a8m7ecXdzchXaHnA5z1JTYffFd3HlOiYpS6y9ddBsdXo2TO0gwQf WTnSveRwE7n4IFmxJUnUhR/+pgVWSEmXxrKE+SxnA6stMj071VeaqFGMEP+pZW24otd3 RdxRqvNtgcW4c3nC3bb8MmKRj24acpCcYmFpY3BBrxEZ5xMbgHW3ozj+k87fBscH4P4V dq9w== 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=GRkc/aE7bxQWfroaFbp5mDMhYOtco1/wqF3xUD9yM3k=; b=Xf8leGjPXkoPt3XY4uDfovhWTezrLluxP3D5BZQRnmsd6BjeYdBltxNylpss6624Wb zXAs0XOPPIgeQxivXbdDRurJdYjxq6GEXlKxAzYepyylr9ra+yUp99JSf3E0oi4feceB ywaBmCHBUAqmtzQZx4JxGrjxfH5104gfJCKDptAkfN54SaxWu3tdqhys5Te7M/3suYsU Kh1FSZ7R6lJc86vggXDWqL+mneTgNHA5gvC+T4h/v9W580aiaFiuZ1a0IYNFzVr3Hq+N RLktE1ZYuqQQYElOtzIwTmmdbR5Rn/6IUnEgjg7KfDpp6YhGF7f6lqS0gDYo37ZcKGHE Qp+w== X-Gm-Message-State: AHQUAuaNt50YquzOl9IwADQ7EDQ2r8QGZetMNA14gK+FREI1Hx2B+Wm8 VphSJrjHBrjik3sjwaBlI44= X-Google-Smtp-Source: AHgI3IaYYcMO7FI/IwKOw1ioK5oDSUtYzx/lqoRry9AQ+62HOo21u1RlzcRpg9/A++4KjncGPFZy4A== X-Received: by 2002:a65:6651:: with SMTP id z17mr17491186pgv.95.1550646006619; Tue, 19 Feb 2019 23:00:06 -0800 (PST) Received: from ubuntu.localdomain (c-76-102-76-212.hsd1.ca.comcast.net. [76.102.76.212]) by smtp.gmail.com with ESMTPSA id x23sm43321773pfe.0.2019.02.19.23.00.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Feb 2019 23:00:06 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Tue, 19 Feb 2019 22:57:15 -0800 Message-Id: <1550645838-417-3-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550645838-417-1-git-send-email-dlu998@gmail.com> References: <1550645838-417-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 v2 3/6] 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 a4608af..acddc02 100644 --- a/lib/ipf.c +++ b/lib/ipf.c @@ -613,7 +613,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; } @@ -693,7 +693,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; } From patchwork Wed Feb 20 06:57:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1045158 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="DpD5t5bc"; 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 4447rn41Hxz9s2R for ; Wed, 20 Feb 2019 18:04:41 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2846A247F; Wed, 20 Feb 2019 07:02:44 +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 900C12492 for ; Wed, 20 Feb 2019 07:00:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id EB33B224 for ; Wed, 20 Feb 2019 07:00:07 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id h1so11441374pfo.7 for ; Tue, 19 Feb 2019 23:00:07 -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=aPSpyt5oJgMt7ilQKb5+qu2N7pMHeZW+8OMKeS4cwys=; b=DpD5t5bcmokEWn9nkFTJQ8DtwdfYzsI0DVXo2NVu3UkRF6SVembJ0xcSmsr22I80ji ZHiXZjjwVyHncJYR0ksJCPrZcaPWR0UKi5tDXmf7PJ5u+oCw4gT+GpQ0wqgqz3mvcSas 1ql1TBhkyoAf+SyLfDRHvWSkBi8/nsEy8cwHIvk1vr7XmW1IwnxTntSYzGYiLz5xAwSC +uQi8VHvksaTugl2/io89bMEgpaPxYrVT3WlETb6HPvFSivjYMMe2X+7Y+EI3G2PGikW mehlzGs1Vd6FGDJIzABqdBwezwv4UH39s2mKCuJ6+1H9poYtdZ3SKbwylYs6zlIXj9Mt zA5w== 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=aPSpyt5oJgMt7ilQKb5+qu2N7pMHeZW+8OMKeS4cwys=; b=oG2R86wpgTdXK7tHg7f3E4TyuYf5yzV7h+4s3uC7Tpnbr6PmUSWqVd7TvnsUNeVX4S qA1yyR6n1vW/mVVlVZx3Rogl/NmH0KkBahkjVHy2r/WrgHaBbhR980ZqNYFH5fa6jxp/ U1hDQ5KsxHSyUb6sDK91n+XGCydBUx40x43sDlnC8wjM5nY7lpI8bbiyousllX1lLC2t GY6R29jReEW0IDFOKmZgUVAPjXkJXG3njXt6YPnkopCpqsXkkaQlatiAuL4Ft9odCFQO 4g8zAyRGq9r4YpJhCN/Th6KSkKgbAruqFzZgDI0wnHnlgXUKLB8mQNCjvpWTlaknTJlk OJvA== X-Gm-Message-State: AHQUAubuhKR9SkR7d5XXTUUVN6+i/R/P20IwurouWlpeQCdfVAKrn7Lq N5/iWIh131DQDKnEvcJIymApZ2P7 X-Google-Smtp-Source: AHgI3IYXrYSm8BmcYdeX/7JJiLwK+Zm9/ItOFXKdZ939BKQpTg34tf51Rq0gaVaa1s8x+jNS8mIB4Q== X-Received: by 2002:a62:18d8:: with SMTP id 207mr11238581pfy.57.1550646007539; Tue, 19 Feb 2019 23:00:07 -0800 (PST) Received: from ubuntu.localdomain (c-76-102-76-212.hsd1.ca.comcast.net. [76.102.76.212]) by smtp.gmail.com with ESMTPSA id x23sm43321773pfe.0.2019.02.19.23.00.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Feb 2019 23:00:07 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Tue, 19 Feb 2019 22:57:16 -0800 Message-Id: <1550645838-417-4-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550645838-417-1-git-send-email-dlu998@gmail.com> References: <1550645838-417-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 v2 4/6] tests: Fix udp checksums for some tests. 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 Signed-off-by: Darrell Ball --- 1/ This patch will fail to merge because it gets corrupted in e-mail because of the long lines, but is submitted for completeness. 2/ Associated 4 system tests will fail until patches 5 and 6 of the series; tests could otherwise be disabled in this patch then re-enabled in patch 6. tests/system-traffic.at | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/system-traffic.at b/tests/system-traffic.at index 6da5ac8..cab461d 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -2899,7 +2899,7 @@ ADD_VETH(p1, at_ns1, br0, "fc00::2/96") # Add different extension headers AT_DATA([bundle.txt], [dnl -packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000000000001100000100000001000100020008d62c00010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) +packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000000000001100000100000001000100020008e04000010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) packet-out in_port=1, packet=50540000000a50540000000986dd60000000002c00fffc000000000000000000000000000001fc0000000000000000000000000000022c00000000000000110001880000000100010002000800000001020304050607080900010203040506070809, actions=ct(commit) ]) @@ -2926,7 +2926,7 @@ ADD_VETH(p1, at_ns1, br0, "fc00::2/96") # Add different extension headers AT_DATA([bundle.txt], [dnl packet-out in_port=1, packet=50540000000a50540000000986dd60000000002c00fffc000000000000000000000000000001fc0000000000000000000000000000022c00000000000000110001880000000100010002000800000001020304050607080900010203040506070809, actions=ct(commit) -packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000000000001100000100000001000100020008d62c00010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) +packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000000000001100000100000001000100020008e04000010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) ]) AT_CHECK([ovs-ofctl bundle br0 bundle.txt]) @@ -2951,7 +2951,7 @@ ADD_VETH(p1, at_ns1, br0, "fc00::2/96") # Add different extension headers AT_DATA([bundle.txt], [dnl -packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000050200001100000100000001000100020008d62c00010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) +packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000050200001100000100000001000100020008e04000010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) packet-out in_port=1, packet=50540000000a50540000000986dd60000000002c00fffc000000000000000000000000000001fc0000000000000000000000000000022c00000005020000110001880000000100010002000800000001020304050607080900010203040506070809, actions=ct(commit) ]) @@ -2978,7 +2978,7 @@ ADD_VETH(p1, at_ns1, br0, "fc00::2/96") # Add different extension headers AT_DATA([bundle.txt], [dnl packet-out in_port=1, packet=50540000000a50540000000986dd60000000002c00fffc000000000000000000000000000001fc0000000000000000000000000000022c00000005020000110001880000000100010002000800000001020304050607080900010203040506070809, actions=ct(commit) -packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000050200001100000100000001000100020008d62c00010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) +packet-out in_port=1, packet=50540000000a50540000000986dd60000000019800fffc000000000000000000000000000001fc0000000000000000000000000000022c000000050200001100000100000001000100020008e04000010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607, actions=ct(commit) ]) AT_CHECK([ovs-ofctl bundle br0 bundle.txt]) From patchwork Wed Feb 20 06:57:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1045159 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="X9wvBtsG"; 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 4447sN57jDz9s2R for ; Wed, 20 Feb 2019 18:05:12 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C5D6124AC; Wed, 20 Feb 2019 07:02:44 +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 1F0D22492 for ; Wed, 20 Feb 2019 07:00:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D97C479 for ; Wed, 20 Feb 2019 07:00:09 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id y4so11374786pgc.12 for ; Tue, 19 Feb 2019 23:00:09 -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=F2kicJvi1DjE+5p/Mr12I7TvMAoAk3ry3AWVKeDggc4=; b=X9wvBtsGeq0vTyD734VVUc4vYKvPTtUZDoSlD42OgOr48L6CGyB9CHNPg0zr/3F5pF 1YIQF5pVOfWv7+VS6loUDPdm25IA2cFFF593BWTFQstw5WKChDRTX9Mk7c4o0mCVzOEa ntE5VE5M2MT41sh65WVI+Q+Sh0cn9UPsZzQeVe+uLxTnWo8bjhCuFp/MGVs76XP+cipx tGMyLob2H7p6lyJj/O2KYwJHQONy9Z5ibNzYLLnUXioIF6xnkCHJsLhdDyG0oy9Q1Gi8 AUXH1v23W9tP2mrcPqDgzYS9EUDQC4XJ+CPp9tOrYlvoeKxZMun5CfnAsJGNw7n//+51 UNZg== 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=F2kicJvi1DjE+5p/Mr12I7TvMAoAk3ry3AWVKeDggc4=; b=XnPLPMlAM5grxW8vuk7KDo96t7TB9BJgj58Y3dAvLJC4NVC/TfzSyzG8X6Qf4WIJMm F03izU6gdyKgVIpWiJKLd9a9XqPR92bc8VOzxeppm1i5EBPDdMZxg9PN/j3qh9PVRZYE FeU5eKP+uVBT8Qte6FDrRhBAvmO9Z6GuF+xY+iLyXlWo43W+iPQbb6ruQa/uZkHiD/0i 2zOwB4C/T7XrtVYsZtEY0zi9hiG8n5Hb7Fih/PTuEf1hZ/XNTQHxtlAvZlZBpq1B7L6C LlFrGE54VEJfzM1JZecfngin+JM2DhEZrsgQNGJ4xec9/V3OIsJNXYEDj7EX+XT9tKgQ ZevQ== X-Gm-Message-State: AHQUAuaWoK9ds6eVB+5UMcC/C9XeIU4po3ZQIA2xyYtrrXy8yWXmhMa8 bDH0LwtwZ/4JIq+jNXp+5PqAoINQ X-Google-Smtp-Source: AHgI3IYnQ5aEYOqXS7tHVpOYrrv8xTDOrjQZ3UUwv2oFHDy4i4K4JsjLzCwB15vuKHfC09e5Hvtf5g== X-Received: by 2002:a63:7444:: with SMTP id e4mr4808652pgn.398.1550646009497; Tue, 19 Feb 2019 23:00:09 -0800 (PST) Received: from ubuntu.localdomain (c-76-102-76-212.hsd1.ca.comcast.net. [76.102.76.212]) by smtp.gmail.com with ESMTPSA id x23sm43321773pfe.0.2019.02.19.23.00.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Feb 2019 23:00:09 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Tue, 19 Feb 2019 22:57:17 -0800 Message-Id: <1550645838-417-5-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550645838-417-1-git-send-email-dlu998@gmail.com> References: <1550645838-417-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 v2 5/6] ipf: Handle non-zero L2 padding for first fragments. 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 --- Following system tests will fail until patch 6 of the series; tests could otherwise be disabled in patch 4 then re-enabled in patch 6. conntrack - IPv6 fragmentation, multiple extension headers conntrack - IPv6 fragmentation, multiple extension headers + out of order conntrack - IPv6 fragmentation, multiple extension headers 2 conntrack - IPv6 fragmentation, multiple extension headers 2 + out of order lib/ipf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ipf.c b/lib/ipf.c index acddc02..97d5b58 100644 --- a/lib/ipf.c +++ b/lib/ipf.c @@ -407,6 +407,7 @@ ipf_reassemble_v4_frags(struct ipf_list *ipf_list) { struct ipf_frag *frag_list = ipf_list->frag_list; struct dp_packet *pkt = dp_packet_clone(frag_list[0].pkt); + dp_packet_set_size(pkt, dp_packet_size(pkt) - dp_packet_l2_pad_size(pkt)); struct ip_header *l3 = dp_packet_l3(pkt); int len = ntohs(l3->ip_tot_len); @@ -451,6 +452,7 @@ ipf_reassemble_v6_frags(struct ipf_list *ipf_list) { struct ipf_frag *frag_list = ipf_list->frag_list; struct dp_packet *pkt = dp_packet_clone(frag_list[0].pkt); + dp_packet_set_size(pkt, dp_packet_size(pkt) - dp_packet_l2_pad_size(pkt)); struct ovs_16aligned_ip6_hdr *l3 = dp_packet_l3(pkt); int pl = ntohs(l3->ip6_plen) - sizeof(struct ovs_16aligned_ip6_frag); From patchwork Wed Feb 20 06:57:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1045160 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="RjFpaFF2"; 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 4447sv24N2z9s2R for ; Wed, 20 Feb 2019 18:05:39 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 7E5E42492; Wed, 20 Feb 2019 07:02:45 +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 DD2A32492 for ; Wed, 20 Feb 2019 07:00:11 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CC88F79 for ; Wed, 20 Feb 2019 07:00:10 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id w7so11364500pgp.13 for ; Tue, 19 Feb 2019 23:00:10 -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:in-reply-to:references; bh=edW9uF3WSh2XuItViEmBu80BBC8EG9E0lp5AYyHuj1A=; b=RjFpaFF2jtKtVFV/4Hccg/RwPv8U/IW0rVOtZ9oygnNTY/qrqXJdZgSu9yVk2N6Qpj xwfCH4zHbBJQyLoP3X0D/lyx33HZpho5wcTAI3TxaDb0UpsRu0m6R7s6E2JX+RHD/rQA m1E1gwqeEc24y2fgLvgNFyS1BXOjrXQ7SJIW2lLQkZdvodAwhtoQTXoTlvIuZTr7aEi1 HgFmyOFUDhASMa+kSS/Egn0QClu1/nP1sreJD0dQd0q/fQfE+fyPy/YG52AmWxpgO5M4 UFib9bP3YUjGqKLn8RBz19pyasqDvktkyZ427PGDf/DZEF93w0l3O1n5vWtGxk9OV89e kPMA== 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:in-reply-to :references; bh=edW9uF3WSh2XuItViEmBu80BBC8EG9E0lp5AYyHuj1A=; b=h6DFOyiy71B9zyNcmKCwPZ6C+8GGVCHJvE4DVVlcNEGenAsBZgaUZMu3sFxT6RFgzl WsWlzHDSaKuRjaUHWFJRzywz6SiqX245FgbmmKLrOCQTiYY2BHicOgMXLCoego2pSzzQ D+76OlOL5hYKlVgZqjTZvga52C7ragfGdyYSrDPcPiRLKD2VdV7ghA6bbgNKuJ1Bf9QB 53O8cah/IR/wmT0ccB0ZEX2VXsflzDYUPDdDG/QRt+j5y5o/GpKU1mFHZu2t/hyh6u5M ADsJCnHmil/oSXHVOjJAEj/s5fQZ73v/GZTPPjv0yV8Z6izlXQmekPEBVGpfEGh58AI5 9o7Q== X-Gm-Message-State: AHQUAuaS8UYKwrNJJ3xuLjN4eVGhtp/QbvrTdOFUGStvhZhK3v9AGjrD 2DZSKrM9FYPVs5fsHWis3bE= X-Google-Smtp-Source: AHgI3IZH85bgvqrHaHUmJDkELb2o456zU8CvgKCr34Vk/Y/8xycF5bbJMwwokc4tdFQNIP1DQ9RPbA== X-Received: by 2002:a65:6149:: with SMTP id o9mr27735642pgv.315.1550646010406; Tue, 19 Feb 2019 23:00:10 -0800 (PST) Received: from ubuntu.localdomain (c-76-102-76-212.hsd1.ca.comcast.net. [76.102.76.212]) by smtp.gmail.com with ESMTPSA id x23sm43321773pfe.0.2019.02.19.23.00.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Feb 2019 23:00:10 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Tue, 19 Feb 2019 22:57:18 -0800 Message-Id: <1550645838-417-6-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550645838-417-1-git-send-email-dlu998@gmail.com> References: <1550645838-417-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 v2 6/6] conntrack: Fix L4 csum for V6 extension hdr pkts. 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 It is a day one issue that got copied to the FTP handling code. Fixes: a489b16854b5 ("conntrack: New userspace connection tracker.") Fixes: bd5e81a0e596 ("Userspace Datapath: Add ALG infra and FTP.") CC: Daniele Di Proietto Signed-off-by: Darrell Ball --- lib/conntrack.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 4d76552..d605382 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -686,10 +686,10 @@ reverse_nat_packet(struct dp_packet *pkt, const struct conn *conn) &conn->key.dst.addr.ipv6, true); } reverse_pat_packet(pkt, conn); - uint32_t icmp6_csum = packet_csum_pseudoheader6(nh6); icmp6->icmp6_base.icmp6_cksum = 0; - icmp6->icmp6_base.icmp6_cksum = csum_finish( - csum_continue(icmp6_csum, icmp6, tail - (char *) icmp6 - pad)); + icmp6->icmp6_base.icmp6_cksum = packet_csum_upperlayer6( + nh6, icmp6, IPPROTO_ICMPV6, + tail - (char *) icmp6 - pad); } pkt->l3_ofs = orig_l3_ofs; pkt->l4_ofs = orig_l4_ofs; @@ -1595,15 +1595,14 @@ checksum_valid(const struct conn_key *key, const void *data, size_t size, if (key->dl_type == htons(ETH_TYPE_IP)) { csum = packet_csum_pseudoheader(l3); + csum = csum_finish(csum_continue(csum, data, size)); } else if (key->dl_type == htons(ETH_TYPE_IPV6)) { - csum = packet_csum_pseudoheader6(l3); + csum = packet_csum_upperlayer6(l3, data, key->nw_proto, size); } else { return false; } - csum = csum_continue(csum, data, size); - - return csum_finish(csum) == 0; + return csum == 0; } static inline bool @@ -3261,16 +3260,14 @@ handle_ftp_ctl(struct conntrack *ct, const struct conn_lookup_ctx *ctx, } th->tcp_csum = 0; - uint32_t tcp_csum; if (ctx->key.dl_type == htons(ETH_TYPE_IPV6)) { - tcp_csum = packet_csum_pseudoheader6(nh6); + th->tcp_csum = packet_csum_upperlayer6(nh6, th, ctx->key.nw_proto, + dp_packet_l4_size(pkt)); } else { - tcp_csum = packet_csum_pseudoheader(l3_hdr); + uint32_t tcp_csum = packet_csum_pseudoheader(l3_hdr); + th->tcp_csum = csum_finish( + csum_continue(tcp_csum, th, dp_packet_l4_size(pkt))); } - const char *tail = dp_packet_tail(pkt); - uint8_t pad = dp_packet_l2_pad_size(pkt); - th->tcp_csum = csum_finish( - csum_continue(tcp_csum, th, tail - (char *) th - pad)); if (seq_skew) { conn_seq_skew_set(ct, &ec->key, now, seq_skew + ec->seq_skew,