Assert that target unnumbered interfaces AND loopbacks also cannot be unnumbered

This commit is contained in:
Pim van Pelt
2024-04-07 17:15:11 +02:00
parent 6352d6892e
commit 6949e72888
3 changed files with 14 additions and 4 deletions

View File

@ -530,7 +530,7 @@ def validate_interfaces(yaml):
f"interface {ifname} unnumbered target {target} cannot be in L2 mode"
)
result = False
if is_unnumbered(yaml, target):
if is_unnumbered(yaml, target) or loopback.is_unnumbered(yaml, target):
msgs.append(
f"interface {ifname} unnumbered target {target} cannot also be unnumbered"
)
@ -692,7 +692,7 @@ def validate_interfaces(yaml):
f"sub-interface {sub_ifname} unnumbered target {target} cannot be in L2 mode"
)
result = False
if is_unnumbered(yaml, target):
if is_unnumbered(yaml, target) or loopback.is_unnumbered(yaml, target):
msgs.append(
f"sub-interface {sub_ifname} unnumbered target {target} cannot also be unnumbered"
)

View File

@ -113,7 +113,7 @@ def validate_loopbacks(yaml):
f"loopback {ifname} unnumbered target {target} does not exist"
)
result = False
if is_unnumbered(yaml, target):
if is_unnumbered(yaml, target) or interface.is_unnumbered(yaml, target):
msgs.append(
f"loopback {ifname} unnumbered target {target} cannot also be unnumbered"
)