(Boeing r1775)
raise exception when veth created with local name longer than 16 bytes
This commit is contained in:
parent
454d17a245
commit
51e17db093
1 changed files with 3 additions and 0 deletions
|
@ -166,6 +166,9 @@ class SimpleLxcNode(PyCoreNode):
|
||||||
sessionid = self.session.shortsessionid()
|
sessionid = self.session.shortsessionid()
|
||||||
name = "n%s.%s.%s" % (self.objid, ifindex, sessionid)
|
name = "n%s.%s.%s" % (self.objid, ifindex, sessionid)
|
||||||
localname = "n%s.%s.%s" % (self.objid, ifname, 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
|
ifclass = VEth
|
||||||
veth = ifclass(node = self, name = name, localname = localname,
|
veth = ifclass(node = self, name = name, localname = localname,
|
||||||
mtu = 1500, net = net, start = self.up)
|
mtu = 1500, net = net, start = self.up)
|
||||||
|
|
Loading…
Reference in a new issue