From 78dd7240cc9ad6551b801942fc6006e718a15114 Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Wed, 6 Sep 2017 12:10:58 +0100 Subject: [PATCH] Assert that IPv6 ctlplane networks should be /64 We're using statless addressing for the ctlplane with requires a /64 network. Change-Id: Ic70b70f1363b97ab7b9e6c671f3106ce350a08a8 --- instack_undercloud/validator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/instack_undercloud/validator.py b/instack_undercloud/validator.py index 604fb2215..e53fcfa9b 100644 --- a/instack_undercloud/validator.py +++ b/instack_undercloud/validator.py @@ -61,6 +61,10 @@ def _validate_value_formats(params, error_callback): local_ip = netaddr.IPNetwork(params['local_ip']) if local_ip.prefixlen == 32: raise netaddr.AddrFormatError('Invalid netmask') + # If IPv6 the ctlplane network uses the EUI-64 address format, + # which requires the prefix to be /64 + if local_ip.version == 6 and local_ip.prefixlen != 64: + raise netaddr.AddrFormatError('Prefix must be 64 for IPv6') except netaddr.core.AddrFormatError as e: message = ('local_ip "%s" not valid: "%s" ' 'Value must be in CIDR format.' %