summaryrefslogtreecommitdiff
path: root/templates/interfaces/pseudo-ethernet
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2012-01-19 19:04:24 -0800
committerStephen Hemminger <shemminger@vyatta.com>2012-01-19 19:04:24 -0800
commit501a4c7fd2ce8af909e553894ee3f1956e29a91c (patch)
treedd935ae13dc3ae2c34c5a168d09981d22879c2a4 /templates/interfaces/pseudo-ethernet
parentfdf34bda65a33229f780a229a05fd300ff1250c5 (diff)
downloadvyatta-cfg-system-501a4c7fd2ce8af909e553894ee3f1956e29a91c.tar.gz
vyatta-cfg-system-501a4c7fd2ce8af909e553894ee3f1956e29a91c.zip
Enforce length restriction on interface description
Bug 7730 Kernel limit on interface description (ifalias) is 256 characters.
Diffstat (limited to 'templates/interfaces/pseudo-ethernet')
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/description/node.def4
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/description/node.def4
2 files changed, 8 insertions, 0 deletions
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/description/node.def b/templates/interfaces/pseudo-ethernet/node.tag/description/node.def
index e2a1534b..e57584a8 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/description/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/description/node.def
@@ -1,4 +1,8 @@
type: txt
help: Description for this interface
+
+syntax:expression: pattern $VAR(@) "^.{1,256}$" \
+ ; "interface description is too long (limit 256 characters)"
+
update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias"
delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias"
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/description/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/description/node.def
index ce6c5fd0..a0b29f05 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/description/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/description/node.def
@@ -1,4 +1,8 @@
type: txt
help: Description
+
+syntax:expression: pattern $VAR(@) "^.{1,256}$" \
+ ; "interface description is too long (limit 256 characters)"
+
update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias"
delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../../@).$VAR(../@)/ifalias"