From 501a4c7fd2ce8af909e553894ee3f1956e29a91c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 19 Jan 2012 19:04:24 -0800 Subject: Enforce length restriction on interface description Bug 7730 Kernel limit on interface description (ifalias) is 256 characters. --- templates/interfaces/bridge/node.tag/description/node.def | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'templates/interfaces/bridge') diff --git a/templates/interfaces/bridge/node.tag/description/node.def b/templates/interfaces/bridge/node.tag/description/node.def index e4807d2f..c6d2789d 100644 --- a/templates/interfaces/bridge/node.tag/description/node.def +++ b/templates/interfaces/bridge/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(../@)/ifalias" delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" -- cgit v1.2.3