From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <t.lamprecht@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 47A717DD56
 for <pve-devel@lists.proxmox.com>; Tue,  9 Nov 2021 17:15:23 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 455931052A
 for <pve-devel@lists.proxmox.com>; Tue,  9 Nov 2021 17:15:23 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 9FB671051B
 for <pve-devel@lists.proxmox.com>; Tue,  9 Nov 2021 17:15:19 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 647D6427FE;
 Tue,  9 Nov 2021 17:15:19 +0100 (CET)
Message-ID: <46238588-9bd7-94e8-bf54-abe9d782f625@proxmox.com>
Date: Tue, 9 Nov 2021 17:15:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101
 Thunderbird/95.0
Content-Language: en-US
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 "DERUMIER, Alexandre" <Alexandre.DERUMIER@groupe-cyllene.com>,
 "aderumier@odiso.com" <aderumier@odiso.com>
References: <20211006083220.1145952-1-aderumier@odiso.com>
 <b129566c-04a1-db7a-e8e3-d1a6439f0781@proxmox.com>
 <d287fefb29cdf7bc1ecafb04582d25e06a9ec401.camel@groupe-cyllene.com>
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
In-Reply-To: <d287fefb29cdf7bc1ecafb04582d25e06a9ec401.camel@groupe-cyllene.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 1.677 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 KAM_SHORT               0.001 Use of a URL Shortener for very short URL
 NICE_REPLY_A            -3.06 Looks like a legit reply (A)
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [omnisecu.com, yhbt.net]
Subject: Re: [pve-devel] [PATCH pve-cluster] sysctl: disable
 net.ipv4.igmp_link_local_mcast_reports
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 09 Nov 2021 16:15:23 -0000

On 09.11.21 16:52, DERUMIER, Alexandre wrote:
> This is really specific to local-link multicast, and it's should only
> be use for some specific routing protocol
> 
> https://yhbt.net/lore/all/1439396033-6264-1-git-send-email-pdowney@brocade.com/T/
> https://www.omnisecu.com/tcpip/ipv4-link-local-multicast-addresses.php
> 
> So, I'll not break multicast services inside the vm.
> 
> Maybe if hypervisor use ospf routing protocol, but anyway, we don't
> have any infos about true vm ip/mac on fwbr bridges.

hmm, ack thx for the info, so the sysctl can be fine.

> actually corretly activate the fwbr bridge before plugging to vmbr,
> 
> my $create_firewall_bridge_linux = sub {
>   ...
>   &$cond_create_bridge($fwbr);
>   &$activate_interface($fwbr);
>   copy_bridge_config($bridge, $fwbr);
>   veth_create($vethfw, $vethfwpeer, $bridge);
> 
>   &$bridge_add_interface($fwbr, $vethfw);
>   &$bridge_add_interface($bridge, $vethfwpeer, $tag, $trunks);
>   &$bridge_add_interface($fwbr, $iface);
> };
> 
> but it seem that igmp is sent some millisecond later
> 
> A simple sleep like,
> 
>   &$cond_create_bridge($fwbr);
>   &$activate_interface($fwbr);
>   sleep(1);
>   &$bridge_add_interface($fwbr, $vethfw);
> 
> and the igmp report from fwbr is not going to vmbr.
> (but, maybe this is more ugly than a sysctl knob)
> 

yeah such sleeps are ugly and still racy, we could poll for the fwbr to be up?

E.g., something like:

my $round = 0;
while (1) {
   last if PVE::Tools::file_read_firstline("/sys/class/net/$fwbr/operstate") =~ "up";
   die "timeout on waiting for $fwbr to become ready\n" if ++$round > 100;
   usleep(10 * 1000); # 100 * 10ms = 1s
}

(did not test it)

>> Should it be an FW option?
> 
> It could be.
> 
> but it need to be persistant at firewall service stop, as when we
> shutdown the server, igmp report could be emit on vm/ct shutdown.
> and at boot, it should be enabled before the vm auto-start
> 
> Personnaly, I think it should be disabled by default, with an knob to
> enable it.
> , as a majority of basic users don't known what it is. (And advanced
> users using routing protocol, should be aware of this option).


ah yea, with default on I meant that the sysctl would be default on (so the local
mcast reporting default off), sorry for the confusion.
We wouldn't need a actual config knob either as an admin that depends on this can
just configure a higher-priority sysctl.d file..