(Boeing r1775)

raise exception when veth created with local name longer than 16 bytes
This commit is contained in:
ahrenholz 2013-09-25 17:34:29 +00:00
parent 454d17a245
commit 51e17db093

View file

@ -166,6 +166,9 @@ class SimpleLxcNode(PyCoreNode):
sessionid = self.session.shortsessionid()
name = "n%s.%s.%s" % (self.objid, ifindex, sessionid)
localname = "n%s.%s.%s" % (self.objid, ifname, sessionid)
if len(ifname) > 16:
raise ValueError, "interface local name '%s' to long" % \
localname
ifclass = VEth
veth = ifclass(node = self, name = name, localname = localname,
mtu = 1500, net = net, start = self.up)