Skip to content

Commit

Permalink
vrrp: fix persistent FAULT state with use_vmac on a down base interface
Browse files Browse the repository at this point in the history
If the base interface of VMAC is down at startup, the VRRP instance will
remain on FAULT state even if the base interface is set up.

Since the base interface is down, the VMAC operational state is also
down and there is no operational IPv6 address. keepalived increments
vrrp->num_script_if_fault. When the interface comes up, the link-local
IPv6 address is set but vrrp->num_script_if_fault is not decremented.
keepalived considers that there is still a remaining fault and keeps
the VRRP instance in FAULT state.

Increment vrrp->num_script_if_fault when an IPv6 appears on the VMAC.

Fixes: 4c7a94a ("vrrp: Make VMAC IPv6 link local address mirror parent interface")
Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Apr 3, 2023
1 parent 58be65e commit 28c4b43
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions keepalived/core/keepalived_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,22 +1027,25 @@ netlink_if_address_filter(__attribute__((unused)) struct sockaddr_nl *snl, struc
!__test_bit(VRRP_VMAC_XMITBASE_BIT, &vrrp->flags) &&
ifa->ifa_family == AF_INET6 &&
vrrp->ifp->is_ours) {
inet_ip6tosockaddr(addr.in6, &vrrp->saddr);
if (vrrp->saddr.ss_family == AF_UNSPEC) {
inet_ip6tosockaddr(addr.in6, &vrrp->saddr);
if (
#if 0
if (IN6_IS_ADDR_UNSPECIFIED(&vrrp->ifp->sin6_addr)) {
/* This should never happen with the current code since we always
* create a link local address on the VMAC interface.
* However, if in future it is decided not to automatically create
* a link local address on the VMAC interface if the parent interface
* does not have one, then we will need the following code
*/
if (add_link_local_address(vrrp->ifp, addr.in6) &&
/* This should never happen with the current code since we always
* create a link local address on the VMAC interface.
* However, if in future it is decided not to automatically create
* a link local address on the VMAC interface if the parent interface
* does not have one, then we will need the following code
*/
add_link_local_address(vrrp->ifp, addr.in6) &&
#endif
vrrp->num_script_if_fault &&
(!__test_bit(VRRP_FLAG_SADDR_FROM_CONFIG, &vrrp->flags) || is_tracking_saddr))
try_up_instance(vrrp, false);
} else
#endif
} else {
inet_ip6tosockaddr(addr.in6, &vrrp->saddr);
reset_link_local_address(&vrrp->ifp->sin6_addr, vrrp);
}
}
#endif
}
Expand Down

0 comments on commit 28c4b43

Please sign in to comment.