Commit a24927cc authored by Xavier Thompson's avatar Xavier Thompson

slapformat: WIP: separate partition and tap range checks

parent 288c6dc2
......@@ -259,10 +259,10 @@ class Computer(object):
interface = self.interface
partitions = self.partitions
# Big enough IPv6 network
ipv6_range = any(p.ipv6_range for p in partitions)
tap_ipv6 = any(p.tap and p.tap.ipv6_gateway for p in partitions)
if ipv6_range or tap_ipv6:
interface.checkIPv6Ranges()
if any(p.ipv6_range for p in partitions):
interface.checkPartitionIPv6Ranges()
if any(p.tap and p.tap.ipv6_gateway for p in partitions):
interface.checkTapIPv6Ranges()
# Warn about IP address/ranges overlaps
self.checkAddressOverlaps()
......@@ -582,10 +582,14 @@ class Interface(object):
ipv4_network, tap_network
)
def checkIPv6Ranges(self):
def checkPartitionIPv6Ranges(self):
if self.ipv6_network.prefixlen > 128 - 16:
self.conf.abort("IPv6 network %s is too small for IPv6 ranges", network)
def checkTapIPv6Ranges(self):
if self.ipv6_network.prefixlen > 128 - 16 - 1:
self.conf.abort("IPv6 network %s is too small for TAP ranges", network)
def getIPv4Network(self, cidr):
if cidr:
# XXX allow ipv4_local_network to be None ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment