From d69d3b2f110cdf859b905eaec1218aa5cc1a958f Mon Sep 17 00:00:00 2001 From: stdweird Date: Tue, 16 Jul 2024 10:34:23 +0200 Subject: [PATCH] ncm-network: nmstate: bond master does not take care of slaves --- ncm-network/src/main/perl/network.pm | 4 +++- ncm-network/src/main/perl/nmstate.pm | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ncm-network/src/main/perl/network.pm b/ncm-network/src/main/perl/network.pm index 55ada87f0b..3aa5180369 100755 --- a/ncm-network/src/main/perl/network.pm +++ b/ncm-network/src/main/perl/network.pm @@ -204,6 +204,8 @@ our @EXPORT = qw($FAILED_SUFFIX # list of constants to allow inheritance via $self->CONSTANTNAME use constant IFCFG_DIR => "/etc/sysconfig/network-scripts"; +use constant BOND_MASTER_STARTS_SLAVES => 1; + sub backup_dir { @@ -1445,7 +1447,7 @@ sub make_ifup $exifiles->{"$cfg_filename"} == $REMOVE) { $self->verbose("Not starting $iface scheduled for removal"); } else { - if ($ifaces->{$iface}->{master}) { + if ($self->BOND_MASTER_STARTS_SLAVES && $ifaces->{$iface}->{master}) { # bonding devices: don't bring the slaves up, only the master $self->verbose("Found SLAVE interface $iface in ifdown map, ", "not starting it with ifup; is left for master $ifaces->{$iface}->{master}."); diff --git a/ncm-network/src/main/perl/nmstate.pm b/ncm-network/src/main/perl/nmstate.pm index 9ab4b4584e..ce60d0e01f 100644 --- a/ncm-network/src/main/perl/nmstate.pm +++ b/ncm-network/src/main/perl/nmstate.pm @@ -41,6 +41,8 @@ Readonly my $YTRUE => $EDG::WP4::CCM::TextRender::ELEMENT_CONVERT{yaml_boolean}- Readonly my $YFALSE => $EDG::WP4::CCM::TextRender::ELEMENT_CONVERT{yaml_boolean}->(0); use constant IFCFG_DIR => "/etc/nmstate"; +use constant BOND_MASTER_STARTS_SLAVES => 0; + sub iface_filename {