From 576dadb1379da130f4ea77f775ea9bb985419616 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 16 Jul 2021 12:54:14 +0200 Subject: [PATCH] interfaces: do not warn about FD if it was not set explicitly As that would be weird, the use explicitly did not configure it, which is OK, and we'd then warn due to *our* fallback to `0`. Signed-off-by: Thomas Lamprecht --- src/PVE/INotify.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index 22f27f1..4ff63e8 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1259,12 +1259,16 @@ sub __interface_to_string { $raw .= "\tbridge-stp $br_stp\n"; $done->{bridge_stp} = 1; - my $br_fd = defined($d->{bridge_fd}) ? $d->{bridge_fd} : 0; - # 0 is only allowed when STP is disabled - if ($no_stp || ($br_fd >= 2 && $br_fd <= 30)) { - $raw .= "\tbridge-fd $br_fd\n"; - } else { - warn "'$iface': ignoring 'bridge_fd' value '$br_fd', outside of allowed range 2-30\n"; + # NOTE: forwarding delay must be 2 <= FD <= 30 if STP is enabled + if (defined(my $br_fd = $d->{bridge_fd})) { + if ($no_stp || ($br_fd >= 2 && $br_fd <= 30)) { + $raw .= "\tbridge-fd $br_fd\n"; + } else { + # only complain if the user actually set a value, but not for default fallback below + warn "'$iface': ignoring 'bridge_fd' value '$br_fd', outside of allowed range 2-30\n"; + } + } elsif ($no_stp) { + $raw .= "\tbridge-fd 0\n"; } $done->{bridge_fd} = 1; -- 2.39.2