# corosync preparation
my $corosync_rule = "-p udp --dport 5404:5405";
my $corosync_local_addresses = {};
+ my $multicast_enabled;
my $local_hostname = PVE::INotify::nodename();
if (defined($corosync_conf)) {
PVE::Corosync::for_all_corosync_addresses($corosync_conf, $ipversion, sub {
$corosync_local_addresses->{$key} = $node_ip;
}
});
+
+ # allow multicast only if enabled in config
+ $multicast_enabled = $corosync_conf->{main}->{totem}->{transport} // 0;
}
# host inbound firewall
# corosync inbound rules
if (defined($corosync_conf)) {
- # always allow multicast
- ruleset_addrule($ruleset, $chain, "-m addrtype --dst-type MULTICAST $corosync_rule", "-j $accept_action");
+ ruleset_addrule($ruleset, $chain, "-m addrtype --dst-type MULTICAST $corosync_rule", "-j $accept_action")
+ if $multicast_enabled;
PVE::Corosync::for_all_corosync_addresses($corosync_conf, $ipversion, sub {
my ($node_name, $node_ip, $node_ipversion, $key) = @_;
# corosync outbound rules
if (defined($corosync_conf)) {
- # always allow multicast
- ruleset_addrule($ruleset, $chain, "-m addrtype --dst-type MULTICAST $corosync_rule", "-j $accept_action");
+ ruleset_addrule($ruleset, $chain, "-m addrtype --dst-type MULTICAST $corosync_rule", "-j $accept_action")
+ if $multicast_enabled;
PVE::Corosync::for_all_corosync_addresses($corosync_conf, $ipversion, sub {
my ($node_name, $node_ip, $node_ipversion, $key) = @_;