confd: add validation of min/max interface name length

A sane interface name is at least two characters long, and in Linux the
interface name (using ip link) is at most 15 characthers long.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-11-20 08:48:20 +01:00
parent 28c5f5e56f
commit 2922b909af
4 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ MODULES=(
"ieee802-ethernet-interface@2019-06-21.yang"
"infix-ethernet-interface@2024-02-27.yang"
"infix-factory-default@2023-06-28.yang"
"infix-interfaces@2024-10-28.yang -e vlan-filtering"
"infix-interfaces@2024-11-12.yang -e vlan-filtering"
# from rousette
"ietf-restconf@2017-01-26.yang"
+1 -1
View File
@@ -1,6 +1,6 @@
# -*- sh -*-
# REMEMBER TO UPDATE infix-interfaces ALSO IN confd.inc
MODULES=(
"infix-interfaces@2024-10-28.yang -e vlan-filtering -e containers"
"infix-interfaces@2024-11-12.yang -e vlan-filtering -e containers"
"infix-containers@2024-10-14.yang"
)
+13
View File
@@ -23,6 +23,11 @@ module infix-interfaces {
contact "kernelkit@googlegroups.com";
description "Linux bridge and lag extensions for ietf-interfaces.";
revision 2024-11-12 {
description "Limit name 1-15 chars, Linux limitation.";
reference "internal";
}
revision 2024-10-28 {
description "Limit description to 64 chars, matching IF-MIB max.";
reference "internal";
@@ -89,6 +94,14 @@ module infix-interfaces {
}
}
deviation "/if:interfaces/if:interface/if:name" {
deviate replace {
type string {
length "1..15";
}
}
}
deviation "/if:interfaces/if:interface/if:description" {
deviate replace {
type string {