summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 297b26cb69..4194dcb1bb 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1157,6 +1157,11 @@ void link_check_ready(Link *link) {
return;
}
+ if (!link->bridge_mdb_configured) {
+ log_link_debug(link, "%s(): Bridge MDB is not configured.", __func__);
+ return;
+ }
+
if (link_has_carrier(link) || !link->network->configure_without_carrier) {
bool has_ndisc_address = false;
NDiscAddress *n;
@@ -1254,30 +1259,6 @@ static int link_set_bridge_fdb(Link *link) {
return 0;
}
-static int link_set_bridge_mdb(Link *link) {
- MdbEntry *mdb_entry;
- int r;
-
- if (!link->network)
- return 0;
-
- if (LIST_IS_EMPTY(link->network->static_mdb_entries))
- return 0;
-
- if (!link->network->bridge) {
- log_link_error(link, "Cannot configure MDB entries on non-bridge port");
- return 0;
- }
-
- LIST_FOREACH(static_mdb_entries, mdb_entry, link->network->static_mdb_entries) {
- r = mdb_entry_configure(link, mdb_entry);
- if (r < 0)
- return log_link_error_errno(link, r, "Failed to add entry to multicast group database: %m");
- }
-
- return 0;
-}
-
static int static_address_ready_callback(Address *address) {
Address *a;
Link *link;
@@ -1410,6 +1391,10 @@ static int link_request_set_addresses(Link *link) {
if (r < 0)
return r;
+ r = link_set_bridge_mdb(link);
+ if (r < 0)
+ return r;
+
r = link_request_set_neighbors(link);
if (r < 0)
return r;
@@ -3931,9 +3916,24 @@ static int link_carrier_gained(Link *link) {
if (r < 0)
return r;
- r = link_set_bridge_mdb(link);
- if (r < 0)
- return r;
+ if (!link->bridge_mdb_configured) {
+ r = link_set_bridge_mdb(link);
+ if (r < 0)
+ return r;
+ }
+
+ if (streq_ptr(link->kind, "bridge")) {
+ Link *slave;
+
+ SET_FOREACH(slave, link->slaves) {
+ if (slave->bridge_mdb_configured)
+ continue;
+
+ r = link_set_bridge_mdb(slave);
+ if (r < 0)
+ link_enter_failed(slave);
+ }
+ }
return 0;
}