diff options
| author | Oleksandr Kuchmystyi <o.kuchmystyi@vyos.io> | 2025-11-28 15:23:58 +0300 |
|---|---|---|
| committer | Oleksandr Kuchmystyi <o.kuchmystyi@vyos.io> | 2025-11-28 15:23:58 +0300 |
| commit | e1fd60f8e46965830cecd1932ac3d2039300b6a7 (patch) | |
| tree | c504ccceb26dc36b026b21a892d5646ebd807a2f /src | |
| parent | 81eb7510621b3aa478359117733204bc7f140931 (diff) | |
| download | vyos-1x-e1fd60f8e46965830cecd1932ac3d2039300b6a7.tar.gz vyos-1x-e1fd60f8e46965830cecd1932ac3d2039300b6a7.zip | |
ipsec: T8001: Commit fails removing VTI interface in IPsec config
Fix cases where commit or IPsec up/down hooks fail if the VTI interface
has already been deleted or the `/tmp/ipsec_vti_interfaces` file does not
exist.
Changes:
- Return empty dict from `get_interface_config()` if it returns None to
avoid TypeError when accessing 'operstate' (vti_updown_db.py).
- Use `open_vti_updown_db_for_create_or_update()` in `vti‑up‑down` script so
the temporary interface tracking file is created automatically when
missing.
Diffstat (limited to 'src')
| -rwxr-xr-x | src/etc/ipsec.d/vti-up-down | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/etc/ipsec.d/vti-up-down b/src/etc/ipsec.d/vti-up-down index 49acd27d2..58089bbae 100755 --- a/src/etc/ipsec.d/vti-up-down +++ b/src/etc/ipsec.d/vti-up-down @@ -29,7 +29,7 @@ from vyos.configquery import ConfigTreeQuery from vyos.configdict import get_interface_dict from vyos.utils.commit import wait_for_commit_lock from vyos.utils.process import call -from vyos.utils.vti_updown_db import open_vti_updown_db_for_update +from vyos.utils.vti_updown_db import open_vti_updown_db_for_create_or_update def supply_interface_dict(interface): # Lazy-load the running config on first invocation @@ -58,10 +58,10 @@ if __name__ == '__main__': wait_for_commit_lock() if verb in ['up-client', 'up-client-v6', 'up-host', 'up-host-v6']: - with open_vti_updown_db_for_update() as db: + with open_vti_updown_db_for_create_or_update() as db: db.add(interface, connection, protocol) db.commit(supply_interface_dict) elif verb in ['down-client', 'down-client-v6', 'down-host', 'down-host-v6']: - with open_vti_updown_db_for_update() as db: + with open_vti_updown_db_for_create_or_update() as db: db.remove(interface, connection, protocol) db.commit(supply_interface_dict) |
