Turn the non-canonical IPv6 address into a warning

This commit is contained in:
2026-04-07 18:54:19 +02:00
parent dde2a5f41c
commit 12486c00fd
3 changed files with 7 additions and 8 deletions

View File

@@ -555,10 +555,10 @@ def validate_interfaces(yaml):
result = False
if not address.is_canonical(addr):
canonical = address.get_canonical(addr)
msgs.append(
f"interface {ifname} IP address {addr} is not canonical, use {canonical}"
logger.warning(
f"interface {ifname} IP address {addr} is not canonical, using {canonical}"
)
result = False
iface["addresses"][iface["addresses"].index(addr)] = canonical
if "l2xc" in iface:
if has_sub(yaml, ifname):

View File

@@ -137,10 +137,10 @@ def validate_loopbacks(yaml):
result = False
if not address.is_canonical(addr):
canonical = address.get_canonical(addr)
msgs.append(
f"loopback {ifname} IP address {addr} is not canonical, use {canonical}"
logger.warning(
f"loopback {ifname} IP address {addr} is not canonical, using {canonical}"
)
result = False
iface["addresses"][iface["addresses"].index(addr)] = canonical
if "mac" in iface and mac.is_multicast(iface["mac"]):
msgs.append(
f"loopback {ifname} MAC address {iface['mac']} cannot be multicast"

View File

@@ -5,8 +5,7 @@ test:
- "interface .* IP address .* conflicts with another"
- "sub-interface .* IP address .* conflicts with another"
- "loopback .* IP address .* conflicts with another"
- "interface .* IP address .* is not canonical, use .*"
count: 15
count: 14
---
interfaces:
GigabitEthernet1/0/0: