diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-09-01 10:40:24 +0000 |
---|---|---|
committer | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-09-04 06:41:48 +0000 |
commit | 5fb77805f0fcc507c6af7b897fcf5a532bf20e42 (patch) | |
tree | 603a1ab5e6c657499042cdd535a1c8b24e04ef2d /src | |
parent | 18a6163ed2e0bbbc2924f893e6954a9eba4470b1 (diff) | |
download | vyos-1x-5fb77805f0fcc507c6af7b897fcf5a532bf20e42.tar.gz vyos-1x-5fb77805f0fcc507c6af7b897fcf5a532bf20e42.zip |
T5533: Fix VRRP IPv6 group enters in FAULT state
Checks if an IPv6 address on a specific network interface is
in the tentative state. IPv6 tentative addresses are not fully configured
and are undergoing Duplicate Address Detection (DAD) to ensure they are
unique on the network.
inet6 2001:db8::3/125 scope global tentative
It tentative state the group enters in FAULT state. Fix it
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/high-availability.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/conf_mode/high-availability.py b/src/conf_mode/high-availability.py index 626a3757e..0121df11c 100755 --- a/src/conf_mode/high-availability.py +++ b/src/conf_mode/high-availability.py @@ -15,6 +15,8 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. +import time + from sys import exit from ipaddress import ip_interface from ipaddress import IPv4Interface @@ -26,11 +28,13 @@ from vyos.ifconfig.vrrp import VRRP from vyos.template import render from vyos.template import is_ipv4 from vyos.template import is_ipv6 +from vyos.utils.network import is_ipv6_tentative from vyos.utils.process import call from vyos import ConfigError from vyos import airbag airbag.enable() + def get_config(config=None): if config: conf = config @@ -171,6 +175,18 @@ def apply(ha): call(f'systemctl stop {service_name}') return None + # Check if IPv6 address is tentative T5533 + for group, group_config in ha['vrrp']['group'].items(): + if 'hello_source_address' in group_config: + if is_ipv6(group_config['hello_source_address']): + ipv6_address = group_config['hello_source_address'] + interface = group_config['interface'] + checks = 20 + interval = 0.1 + for _ in range(checks): + if is_ipv6_tentative(interface, ipv6_address): + time.sleep(interval) + call(f'systemctl reload-or-restart {service_name}') return None |