From 35669222aa35c444f16a74470e670cc05cf4c9bd Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 20:37:01 +0000 Subject: Apply patch libteam-Revert-teamd-Disregard-current-state-when-considerin.patch patch_name: libteam-Revert-teamd-Disregard-current-state-when-considerin.patch present_in_specfile: true location_in_specfile: 1 --- diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c index 166da57..d429753 100644 --- a/teamd/teamd_per_port.c +++ b/teamd/teamd_per_port.c @@ -442,14 +442,18 @@ int teamd_port_check_enable(struct teamd_context *ctx, bool should_enable, bool should_disable) { bool new_enabled_state; + bool curr_enabled_state; int err; if (!teamd_port_present(ctx, tdport)) return 0; + err = teamd_port_enabled(ctx, tdport, &curr_enabled_state); + if (err) + return err; - if (should_enable) + if (!curr_enabled_state && should_enable) new_enabled_state = true; - else if (should_disable) + else if (curr_enabled_state && should_disable) new_enabled_state = false; else return 0;