summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-12 23:26:57 +0200
committerGitHub <noreply@github.com>2021-06-12 23:26:57 +0200
commit198c25432227d30f4c2f5685b008d1daf681996c (patch)
tree6b47de93c252b8ac42827034421570c389a371b9
parent5d687daba3a33e7619d4ec8cc08792e6c2bfa0c7 (diff)
parent6c7e22e730daf835080bdb384f1e08eb766fbe85 (diff)
downloadvyos-1x-198c25432227d30f4c2f5685b008d1daf681996c.tar.gz
vyos-1x-198c25432227d30f4c2f5685b008d1daf681996c.zip
Merge pull request #876 from sarthurdev/link_local
ipsec: T1501: Use vyos.validate.is_ipv6_link_local
-rwxr-xr-xsrc/conf_mode/vpn_ipsec.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conf_mode/vpn_ipsec.py b/src/conf_mode/vpn_ipsec.py
index 3eaa78a4b..f80a9455a 100755
--- a/src/conf_mode/vpn_ipsec.py
+++ b/src/conf_mode/vpn_ipsec.py
@@ -25,6 +25,7 @@ from vyos.configverify import verify_interface_exists
from vyos.ifconfig import Interface
from vyos.template import ip_from_cidr
from vyos.template import render
+from vyos.validate import is_ipv6_link_local
from vyos.util import call
from vyos.util import dict_search
from vyos.util import get_interface_address
@@ -173,7 +174,7 @@ def get_dhcp_address(iface):
if not addresses:
return None
for address in addresses:
- if not address.startswith("fe80:"): # Skip link-local ipv6
+ if not is_ipv6_link_local(address):
return ip_from_cidr(address)
return None