summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-12-10 17:12:24 -0600
committerGitHub <noreply@github.com>2022-12-10 17:12:24 -0600
commitfb6ceae548ecd7ed180b452bd35531985a46aba9 (patch)
tree5e5c14926b627e4b275c323432b77ed7b230411b /src
parent810be56a7c74cc6ef09550cf8b85acc1b8408cc2 (diff)
parent779f4001a4828f1af39a5b0b861d62635fcb3726 (diff)
downloadvyos-1x-fb6ceae548ecd7ed180b452bd35531985a46aba9.tar.gz
vyos-1x-fb6ceae548ecd7ed180b452bd35531985a46aba9.zip
Merge pull request #1703 from jestabro/bug-tunnel-ip
openvpn: T4872: fix parsing of tunnel IP in 'show openvpn server'
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/show_openvpn.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/op_mode/show_openvpn.py b/src/op_mode/show_openvpn.py
index 9a5adcffb..e29e594a5 100755
--- a/src/op_mode/show_openvpn.py
+++ b/src/op_mode/show_openvpn.py
@@ -59,7 +59,11 @@ def get_vpn_tunnel_address(peer, interface):
for line in lines:
if peer in line:
lst.append(line)
- tunnel_ip = lst[1].split(',')[0]
+
+ # filter out subnet entries
+ lst = [l for l in lst[1:] if '/' not in l.split(',')[0]]
+
+ tunnel_ip = lst[0].split(',')[0]
return tunnel_ip