diff --git a/debian-package/debian/changelog b/debian-package/debian/changelog index 4aca898..e1eecf8 100644 --- a/debian-package/debian/changelog +++ b/debian-package/debian/changelog @@ -1,3 +1,10 @@ +vpn-router (0.4.3-1) unstable; urgency=medium + + * swanctl output with more closing than opening lines is read as not + available instead of failing the request. + + -- Slawomir Koszewski Fri, 23 Oct 2026 22:00:00 +0200 + vpn-router (0.4.2-1) unstable; urgency=medium * /config gives the IPsec connections and SAs as objects, read from diff --git a/debian-package/src/usr/lib/vpn-router/web b/debian-package/src/usr/lib/vpn-router/web index 7b240d6..f5f36d5 100644 --- a/debian-package/src/usr/lib/vpn-router/web +++ b/debian-package/src/usr/lib/vpn-router/web @@ -91,6 +91,7 @@ def swanctl(command): whose value may contain spaces. Every "... event {" section at the top holds one connection or SA; each becomes an entry with its name under "name". The closing "... reply {" section is left out. Values stay strings, as swanctl prints them. + Output with more closing than opening lines gives None. """ result = run('swanctl', command, '--pretty') if result is None or result.returncode != 0: @@ -102,6 +103,8 @@ def swanctl(command): if not line: continue if line in ('}', ']'): + if not stack: + return None stack.pop() elif not stack: section = {}