From patchwork Thu Aug 27 14:47:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1352622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jRUK2OcC; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bclvj6kK2z9sRK for ; Fri, 28 Aug 2020 00:48:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1F53B8848F; Thu, 27 Aug 2020 14:48:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id waAhtRQVg009; Thu, 27 Aug 2020 14:47:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 3BDE688398; Thu, 27 Aug 2020 14:47:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1A9CAC07FF; Thu, 27 Aug 2020 14:47:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 499E2C0051 for ; Thu, 27 Aug 2020 14:47:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3EE1F868E7 for ; Thu, 27 Aug 2020 14:47:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iizYJlFWawxd for ; Thu, 27 Aug 2020 14:47:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by whitealder.osuosl.org (Postfix) with ESMTPS id 565E5868B0 for ; Thu, 27 Aug 2020 14:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598539676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:content-type:content-type; bh=d3LcASAU1KkPcf1/FxsVR76voJ9zh0crlDdeG0ppeyA=; b=jRUK2OcCqxsZhcaXcpinUu1cWub8wFXVY4bZ1p9xcGuXCHMkAEYhM6qLd/mPusbUq+zLjl zXm89QsCh5ZjdmCvaTE2+bo8nrHNeHlKU6NlLJWUlDukhMd1iquvGJ5khahdvtgMAmZR4v hKy7EB9jSRmuCupiLVvbKKrymMEXtB8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-yYC2N7q6ORK3eMj68082Pg-1; Thu, 27 Aug 2020 10:47:53 -0400 X-MC-Unique: yYC2N7q6ORK3eMj68082Pg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D27871030989 for ; Thu, 27 Aug 2020 14:47:52 +0000 (UTC) Received: from dceara.remote.csb (ovpn-113-221.ams2.redhat.com [10.36.113.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A7675C1D0 for ; Thu, 27 Aug 2020 14:47:52 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Thu, 27 Aug 2020 16:47:33 +0200 Message-Id: <1598539653-785-1-git-send-email-dceara@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] pinctrl: Fix incorrect warning message for multicast querier. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" It's quite common that IP Multicast is enabled only for IPv4 or only for IPv6. In such cases ovn-controller should not generate warnings. Fixes: 677a3ba4d66b ("ovn: Add MLD support.") Signed-off-by: Dumitru Ceara --- controller/pinctrl.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index f72ab70..c8fbd37 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -4183,21 +4183,11 @@ ip_mcast_snoop_cfg_load(struct ip_mcast_snoop_cfg *cfg, cfg->seq_no = ip_mcast->seq_no; if (querier_enabled) { - /* Try to parse the source ETH address. */ - if (!ip_mcast->eth_src || - !eth_addr_from_string(ip_mcast->eth_src, - &cfg->query_eth_src)) { - VLOG_WARN_RL(&rl, - "IGMP Querier enabled with invalid ETH src address"); - /* Failed to parse the ETH source address. Disable the querier. */ - cfg->querier_v4_enabled = false; - cfg->querier_v6_enabled = false; - } - /* Try to parse the source IPv4 address. */ if (cfg->querier_v4_enabled) { - if (!ip_mcast->ip4_src || - !ip_parse(ip_mcast->ip4_src, &cfg->query_ipv4_src)) { + if (!ip_mcast->ip4_src || !ip_mcast->ip4_src[0]) { + cfg->querier_v4_enabled = false; + } else if (!ip_parse(ip_mcast->ip4_src, &cfg->query_ipv4_src)) { VLOG_WARN_RL(&rl, "IGMP Querier enabled with invalid IPv4 " "src address"); @@ -4215,8 +4205,9 @@ ip_mcast_snoop_cfg_load(struct ip_mcast_snoop_cfg *cfg, /* Try to parse the source IPv6 address. */ if (cfg->querier_v6_enabled) { - if (!ip_mcast->ip6_src || - !ipv6_parse(ip_mcast->ip6_src, &cfg->query_ipv6_src)) { + if (!ip_mcast->ip6_src || !ip_mcast->ip6_src[0]) { + cfg->querier_v6_enabled = false; + } else if (!ipv6_parse(ip_mcast->ip6_src, &cfg->query_ipv6_src)) { VLOG_WARN_RL(&rl, "MLD Querier enabled with invalid IPv6 " "src address"); @@ -4232,6 +4223,23 @@ ip_mcast_snoop_cfg_load(struct ip_mcast_snoop_cfg *cfg, cfg->query_ipv6_dst = (struct in6_addr)IN6ADDR_ALL_HOSTS_INIT; } + + if (!cfg->querier_v4_enabled && !cfg->querier_v6_enabled) { + VLOG_WARN_RL(&rl, + "IGMP Querier enabled without a valid IPv4 or IPv6 " + "address"); + } + + /* Try to parse the source ETH address. */ + if (!ip_mcast->eth_src || + !eth_addr_from_string(ip_mcast->eth_src, + &cfg->query_eth_src)) { + VLOG_WARN_RL(&rl, + "IGMP Querier enabled with invalid ETH src address"); + /* Failed to parse the ETH source address. Disable the querier. */ + cfg->querier_v4_enabled = false; + cfg->querier_v6_enabled = false; + } } }