diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2026-10-30 16:08:18 +0200 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2026-10-30 16:08:18 +0200 |
| commit | d7810f7aaf0e3cf4f3b3e8cb0845e84d4b59cbf2 (patch) | |
| tree | 0c31fd369330a65203f94bec4919d0f5a815e220 /src | |
| parent | cc972e7de80aea6101e936bffde775c0ee86bbc4 (diff) | |
| download | vyos-1x-d7810f7aaf0e3cf4f3b3e8cb0845e84d4b59cbf2.tar.gz vyos-1x-d7810f7aaf0e3cf4f3b3e8cb0845e84d4b59cbf2.zip | |
nhrp: T9546: Remove nftables rules when NHRP is deleted
Deleting NHRP left its nft tables in place. The conf script skipped
regenerating the ruleset on delete but still reloaded the existing file,
so the multicast drop rules stayed active.
On delete the ruleset is now rendered without NHRP config, which only
removes the NHRP tables. The smoketest checks after each test that no
NHRP tables remain.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/conf_mode/protocols_nhrp.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/conf_mode/protocols_nhrp.py b/src/conf_mode/protocols_nhrp.py index 1e9220fce..66aa700f3 100755 --- a/src/conf_mode/protocols_nhrp.py +++ b/src/conf_mode/protocols_nhrp.py @@ -98,9 +98,12 @@ def generate(config_dict): if not has_frr_protocol_in_dict(config_dict, 'nhrp'): return None - if 'deleted' in config_dict['nhrp']: - return None - render(nhrp_nftables_conf, 'frr/nhrpd_nftables.conf.j2', config_dict['nhrp']) + nhrp = config_dict['nhrp'] + # Without NHRP config the template only deletes its nft tables + if 'deleted' in nhrp: + nhrp = {} + + render(nhrp_nftables_conf, 'frr/nhrpd_nftables.conf.j2', nhrp) return None |
