From patchwork Mon Feb 25 23:06:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1048016 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="DfyfFsvH"; 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 447d604Fr6z9s71 for ; Tue, 26 Feb 2019 10:13:12 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EA233683E; 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 C63EA681D for ; Mon, 25 Feb 2019 23:07:09 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8080612E for ; Mon, 25 Feb 2019 23:07:09 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id q17so5197227pfh.10 for ; Mon, 25 Feb 2019 15:07: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; bh=aFPV1M8tCc0tlDRPDbNO5mLqnzOIy/GyeZ2n/bpGwFg=; b=DfyfFsvH4xrTLpdK7zk4y7z7njpU+hOlod+WTkytDgktmstloyzRnC7VdKRsKuC5MU WF6g6sNaIazJFlRUmGiVlCK+89tyo9YfaOJtbzCOte0qzMEIA/RGX3DEVYX3gvCrA9U6 7XsEKE7bLUPx3BHLC8txawmo6MhhOIf+BCO+sepS73Lfr62HSdGsJMOj337iV6bna2VS vmCzbJ1vyxFyP7b07Ab0ChwxlKY+QCgb0uNWRFJBJlNAdYB4NfqdVb+ffuSWNw8g8ORr v70XPcssSKvlh79rWZrMm1dq88/fn9T777EYahdnO+VxpzmiI7O4+O7ihBXWxOqdotlr UvbA== 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=aFPV1M8tCc0tlDRPDbNO5mLqnzOIy/GyeZ2n/bpGwFg=; b=a0Nl6pugrVfAYEz57WKnuiuxeHP7AJQ8BdDRWSNlpzGpcCUUqL7QrwblwNP4nA1tJG PvaHpfG3tqiyJ4ja+KH13Oa1S567l2lsOGqZwO+tyD3UjH49JuRO3eORYZpQF15oi9Vx E8zqJxYpo3LatVz/XyEjL42IkzV/H/PDjkRnsKCCWxIgpy9c7sW64A1jesXXONLJ6ULA IpWdYQijDrIzZP7XR7+ZwqTdeCFjTLzON5E+d4fZ3fOuwpaFaq7bymI8OdJLaFfBMwPT eyMif5/e3BkjgGOFMLLDQKGqqm5VkDIU8ic7ozRg11j4tCnTe6PN3qPO4hHKA+oZ03yh KB+g== X-Gm-Message-State: AHQUAubSEJ0xTrS/QbhCR/abf5KNrhyOkNfNPTqeEdq5sbXEwE58TBNq kDSQ1QkJGRrzSwfCWQBDT40= X-Google-Smtp-Source: AHgI3IZocdph9/z1+BJOEYzFV7tGq5t9neaO5b4SnUcrVDduou+g5WKjONNL5I+wEL7tywhXM1Ch3Q== X-Received: by 2002:a62:398d:: with SMTP id u13mr22720405pfj.32.1551136029148; Mon, 25 Feb 2019 15:07: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 g67sm29409679pfg.13.2019.02.25.15.07.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 15:07:08 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Mon, 25 Feb 2019 15:06:59 -0800 Message-Id: <1551136020-121835-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.7 1/2] packets: Change return type for '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 fa70df6..3a0c432 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -1459,7 +1459,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 6cdb247..a0c944f 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -851,7 +851,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:07:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 1048017 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="cT65jhUq"; 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 447d6S2kPyz9s6w for ; Tue, 26 Feb 2019 10:13:36 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A78026844; Mon, 25 Feb 2019 23:12:23 +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 354BC681D for ; Mon, 25 Feb 2019 23:07:11 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id F084012E for ; Mon, 25 Feb 2019 23:07:10 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id bj4so5193216plb.7 for ; Mon, 25 Feb 2019 15:07: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=4EjWeZGAHahcGfcBOEuKHVnyc+/6D1w25IF8XQJ93XU=; b=cT65jhUqj36rOn1NiAkCieCDCRLXoTeZ/k/4/9OCK6J2JRt0nkR+y4Hff6okK5zSJb 8ARkTgM175s7sqdvIy8B1FyYCyrszso7BJatPREOQPmPh+lWehBO2mJ8XAxcf+4ouMGH 5Nvlwk/+YhH0jIUaLawziJOYcEL11859meBVroA3O3egm0O13HN3No8qZEwxWgKh/mSd wGyRpHT7KBo13eAWb9dVwJ/zQBnntAZxcRLCM6yYdYPCExzTbJTaVb9s8yMZnhDN0nc8 sqQZFpITIg9pUqG48Wh/LyaKM3c8wWuHaUxTUzTjTGmcs98zoX18Hy/xGcsZTx4q/etJ HfSg== 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=4EjWeZGAHahcGfcBOEuKHVnyc+/6D1w25IF8XQJ93XU=; b=F7EY+ax3KItuJy4AQZESnfqXjzep9O16S0e6JO/uVc4Qggfpeze+LU2RORdTBh0fk9 QfvUZEkDYHL0bYFnUZ0fhclRpRB+CHef/MvedKZOJbJqFx9CPqwQsI4qH9H6AxOgLnxN SQOECa2jG5fbTOlwekSq9E/4YxA0XA1M2brAgTW3hmCtJWMYT+ibWvdtcq5qt0EzjsSo VNIdPzMMiRNaSOiJsnVc1LmPOp7XAZg/BwqkXe6V1S1QniBFRuy86CqgDgA9le0b3cQ1 xAOdtKoquMiwbgPGgo+MW4gsnAoVEnlq6L0OAa7PMZKaR/1OmQ8Byh15nkXervJ+4gOe gQiQ== X-Gm-Message-State: AHQUAuYJncLaWdEl0DgF0ggUU0BdjhkhKRBau4r1X7ngz0OWftLPRyf1 d3IwUPolBQtYsKeeIU21ZkU= X-Google-Smtp-Source: AHgI3IbKW9od/FVSvcaEUO23EtEL7UBu3cSzc/XssiJO57JcTo953T+softrOpF0M1/V/E2lHnzhpg== X-Received: by 2002:a17:902:380c:: with SMTP id l12mr22483705plc.326.1551136030525; Mon, 25 Feb 2019 15:07: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 g67sm29409679pfg.13.2019.02.25.15.07.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Feb 2019 15:07:09 -0800 (PST) From: Darrell Ball To: dlu998@gmail.com, dev@openvswitch.org Date: Mon, 25 Feb 2019 15:07:00 -0800 Message-Id: <1551136020-121835-2-git-send-email-dlu998@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1551136020-121835-1-git-send-email-dlu998@gmail.com> References: <1551136020-121835-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.7 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.") 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