Skip to content

Commit

Permalink
vrrp: fix non-existent vmac base interface at reload
Browse files Browse the repository at this point in the history
When an existing VMAC VRRP instance is updated with a base interface
that does not exists, the instance goes to FAULT state for a good
reason. However, when the base interface is appears, the VMAC interface
is never updated so the instance remains in FAULT state.

Delete the VMAC interface if the base interface is changed to a
non-existent one. The VMAC interface will be re-created when the base
interface appears.

Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Apr 6, 2023
1 parent 58be65e commit 89dc1a6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion keepalived/vrrp/vrrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3481,7 +3481,16 @@ vrrp_complete_instance(vrrp_t * vrrp)
log_message(LOG_INFO, "(%s) %s %s already exists but is incompatible."
" It will be deleted/updated"
, vrrp->iname, if_type, vrrp->vmac_ifname);
if (ifp->base_ifp->ifindex != vrrp->configured_ifp->ifindex)
if (reload && ifp->is_ours && !vrrp->ifp->base_ifp->ifindex) {
/* The base interface in the new configuration does not exist. */
list_for_each_entry(old_vrrp, &old_vrrp_data->vrrp, e_list) {
if (old_vrrp->ifp->ifindex == ifp->ifindex) {
log_message(LOG_INFO, "(%s) Deleting old VMAC interface %s", vrrp->iname, ifp->ifname);
netlink_link_del_vmac(old_vrrp);
break;
}
}
} else if (ifp->base_ifp->ifindex != vrrp->configured_ifp->ifindex)
old_interface = ifp;
} else {
report_config_error(CONFIG_GENERAL_ERROR, "(%s) %s interface name %s"
Expand Down

0 comments on commit 89dc1a6

Please sign in to comment.