From patchwork Mon Feb 25 23:04:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1048013 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="vQBq3zAQ"; 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 447d5457qXz9s6w for ; Tue, 26 Feb 2019 10:12:24 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2BDD76836; Mon, 25 Feb 2019 23:12:21 +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 3200B5D5B for ; Mon, 25 Feb 2019 23:05:00 +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 37A7A12E for ; Mon, 25 Feb 2019 23:04:59 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id d25so5199111pfn.8 for ; Mon, 25 Feb 2019 15:04:59 -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=2GLM7XQZod6J9kB/mi/BB00sSB93KK5INWkl1/mjAp8=; b=vQBq3zAQODAKdiv8Tk5FG+Wgn57yswklI7kmaYTAbn+jjxzrzCdlcIMUmBMjkG/utz s/TabqFBSM9jiu/R0MlVdwKsU+dgRtglbhnYm2E0aFjBpufn3SSGae0DRAQFBlvDa9ud DDsdsz59TSbVb5cb2zJryjdjEbc8Me0q1nmLXumrQxk47D/SjrAmL9J5x5PdXvsLvEYe pwIjizYNRSTnE//nb5sGEGMhvPee3B8u9wuNF16oroOQcwBN31fQAq0oqz8ewttflE/M MWu94BdWpe1HByzOeaiGot7dsH5D22R97WstAsbzcK0RBmFOpcU1/O2lGd7vFLaVNCGz C9OA== 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=2GLM7XQZod6J9kB/mi/BB00sSB93KK5INWkl1/mjAp8=; b=IYCRjI0pCH+KqAzkbPHKJwcbdqW9Zv3KNJ+CBoAGz/BRcZDyp/icU7QT4FAE+h0c8n l08zCey4ktZDF6BG9p6r5kjMCpJmXSYGAR/dPcaSFXa1D5smrHQgOfcwF9SwjZu8qbw8 Nk/tSPrf2qKv2lFCjrSWNkIu7WPNW3W5fCr18IvD8Dpp5MvAnZIX4OP88dVFL5NzmCM1 8fvm3wT3BrlHezJLrs4odiQcfQnQYwhxmNRKck4wbzTaLPOBk37wIINgVPK1MWVdNXZm ffoili3JzGdYRKPZTRAveiRibZ7CdGiOxh1OIZUfIXDlnQXN6zhICNKHBndIVGUiiUpe kZrQ== X-Gm-Message-State: AHQUAuZ9bOvr6EDTYwLe7UogE7UFx6Lz3UjpGTN+KeFNA1wJsRrFtERB d6qoNrECPJBqUhNQQE88ZiUl5Z0E X-Google-Smtp-Source: AHgI3IbEEZXwGPBM/Feq21pb2HZrTanRcpPI7s9I90oX+HZImzesq7cyWhSBF2q2J2HFfMSF/EAsgQ== X-Received: by 2002:a63:4d4f:: with SMTP id n15mr21421258pgl.327.1551135898842; Mon, 25 Feb 2019 15:04:58 -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 j14sm14137314pfe.12.2019.02.25.15.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 15:04:57 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Mon, 25 Feb 2019 15:04:49 -0800 Message-Id: <1551135890-121740-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] [branch-2.6 1/2] packets: Change return type of 'packet_csum_upperlayer6()'. 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/packets.c | 2 +- lib/packets.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/packets.c b/lib/packets.c index 72a118c..8e1e2af 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -1458,7 +1458,7 @@ packet_csum_pseudoheader6(const struct ovs_16aligned_ip6_hdr *ip6) /* Calculate the IPv6 upper layer checksum according to RFC2460. We pass the ip6_nxt and ip6_plen values, so it will also work if extension headers are present. */ -uint16_t +ovs_be16 packet_csum_upperlayer6(const struct ovs_16aligned_ip6_hdr *ip6, const void *data, uint8_t l4_protocol, uint16_t l4_size) diff --git a/lib/packets.h b/lib/packets.h index 21a289d..0705576 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -841,7 +841,7 @@ struct icmp6_header { BUILD_ASSERT_DECL(ICMP6_HEADER_LEN == sizeof(struct icmp6_header)); uint32_t packet_csum_pseudoheader6(const struct ovs_16aligned_ip6_hdr *); -uint16_t packet_csum_upperlayer6(const struct ovs_16aligned_ip6_hdr *, +ovs_be16 packet_csum_upperlayer6(const struct ovs_16aligned_ip6_hdr *, const void *, uint8_t, uint16_t); /* Neighbor Discovery option field. From patchwork Mon Feb 25 23:04:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1048014 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="dCTKhZS6"; 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 447d5X3186z9s6w for ; Tue, 26 Feb 2019 10:12:48 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0B15A6838; Mon, 25 Feb 2019 23:12:22 +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 1B3385D5B for ; Mon, 25 Feb 2019 23:05:02 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 28A7D12E for ; Mon, 25 Feb 2019 23:05:01 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id i19so5220225pfd.0 for ; Mon, 25 Feb 2019 15:05:01 -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=W9ogW018BMkm4/B9WBO4K98ldeL3nHwF7vRQ4P1JHW4=; b=dCTKhZS6phdP/GG39NDvuGCqYRUNuLvltNjvmj99tG1OSlb6+NQa9ntzBGv81sC91T ydT4faiMNpQ2vMSH2lwtpi/C5cxceEtr7enlj+TBsYhNDr88r/UBLOpRfBSfulk6WHYx 21UygXTQwBLThTPPXmP+5MKo5MMLN/w0GjbprSAB4Gk6P0NXF1ETuyGrA1y4l9SRvY+t P7Dm9R6+jUMbAwcwsIafq/IM7i2B1O3+xjg91UoPS1+TD+Kfji0CokDK+UxUef+bbHFg aqaX4LexvhaEI7/dieY3dMvTTwsLQ9Wcqv7H+Pm1hbiVZyfy07TfRmU0EcIaZCaZm5kI eZPA== 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=W9ogW018BMkm4/B9WBO4K98ldeL3nHwF7vRQ4P1JHW4=; b=I/YLBInPDW50w4kt4OC1woT4Hx78XY04pYjGXlwYRJmpFKbOaO988zu65UrA3X+3bm Aj/B+DyJWHmsToMEbEpsC+8nGUuMrLu7GYBk/uYcZUiW8CegT04lpJjnq7ISN7j1BUCP 8NiJF3s+JCPOmkEhidFH/jgot5otpNhVAF/voBKXqveR18qyD17Kyltny8WkIUZCRyOB Ngh3c1067GT4pb/uS/OMbq88FCuSo1/mmNzV7UlJNu858vR9vs/ZSJ5WCE5n91zq9y6t YiUbgMNmjNHM2i10OW9wcfLoDuduWBHD7IueyEU7HCChSoIAaHoPVQED+MMP0VWzEyYG kCkw== X-Gm-Message-State: AHQUAuYRyju+2V+rG9zkxCMjWvz+X1Bwl+aG9CbFoK9TrM1RYoTjjAL9 DhTRcEzl6JJeIBxG1/L6uD8= X-Google-Smtp-Source: AHgI3IZ4BVtQZEwwO26zWMei0+J8WDSfipDR9sYbkbJscoP62wgmAJoc2E6e5b+APtpk6vzjzKJk+Q== X-Received: by 2002:a63:1266:: with SMTP id 38mr21123078pgs.388.1551135900360; Mon, 25 Feb 2019 15:05:00 -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 j14sm14137314pfe.12.2019.02.25.15.04.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 15:04:59 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Mon, 25 Feb 2019 15:04:50 -0800 Message-Id: <1551135890-121740-2-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551135890-121740-1-git-send-email-dlu998@gmail.com> References: <1551135890-121740-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] [branch-2.6 2/2] 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 subsequent 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 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 1917fd8..2f2e6a3 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -603,19 +603,14 @@ static inline bool checksum_valid(const struct conn_key *key, const void *data, size_t size, const void *l3) { - uint32_t csum = 0; - if (key->dl_type == htons(ETH_TYPE_IP)) { - csum = packet_csum_pseudoheader(l3); + uint32_t csum = packet_csum_pseudoheader(l3); + return csum_finish(csum_continue(csum, data, size)) == 0; } else if (key->dl_type == htons(ETH_TYPE_IPV6)) { - csum = packet_csum_pseudoheader6(l3); + return packet_csum_upperlayer6(l3, data, key->nw_proto, size) == 0; } else { return false; } - - csum = csum_continue(csum, data, size); - - return csum_finish(csum) == 0; } static inline bool