networkd: keep bond slave up if already attached
There is no need to disable an already correct enslaved interface. relates to #10118
This commit is contained in:
parent
cc3981b127
commit
cbff717048
|
@ -469,6 +469,10 @@ static int link_new(Manager *manager, sd_netlink_message *message, Link **ret) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = sd_netlink_message_read_u32(message, IFLA_MASTER, (uint32_t *)&link->master_ifindex);
|
||||||
|
if (r < 0)
|
||||||
|
log_link_debug_errno(link, r, "New device has no master, continuing without");
|
||||||
|
|
||||||
r = sd_netlink_message_read_ether_addr(message, IFLA_ADDRESS, &link->mac);
|
r = sd_netlink_message_read_ether_addr(message, IFLA_ADDRESS, &link->mac);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
log_link_debug_errno(link, r, "MAC address not found for new device, continuing without");
|
log_link_debug_errno(link, r, "MAC address not found for new device, continuing without");
|
||||||
|
@ -2358,6 +2362,10 @@ static int link_enter_join_netdev(Link *link) {
|
||||||
return link_joined(link);
|
return link_joined(link);
|
||||||
|
|
||||||
if (link->network->bond) {
|
if (link->network->bond) {
|
||||||
|
if (link->network->bond->state == NETDEV_STATE_READY &&
|
||||||
|
link->network->bond->ifindex == link->master_ifindex)
|
||||||
|
return link_joined(link);
|
||||||
|
|
||||||
log_struct(LOG_DEBUG,
|
log_struct(LOG_DEBUG,
|
||||||
LOG_LINK_INTERFACE(link),
|
LOG_LINK_INTERFACE(link),
|
||||||
LOG_NETDEV_INTERFACE(link->network->bond),
|
LOG_NETDEV_INTERFACE(link->network->bond),
|
||||||
|
|
|
@ -52,6 +52,7 @@ typedef struct Link {
|
||||||
unsigned n_ref;
|
unsigned n_ref;
|
||||||
|
|
||||||
int ifindex;
|
int ifindex;
|
||||||
|
int master_ifindex;
|
||||||
char *ifname;
|
char *ifname;
|
||||||
char *kind;
|
char *kind;
|
||||||
unsigned short iftype;
|
unsigned short iftype;
|
||||||
|
|
Loading…
Reference in a new issue