use hex value for short session ID used in naming interfaces

use interface names "vethOOOOO.ii.ss" and "vethOOOOO.iipss" for veth pairs

(where OOOOO = object id, ii = interface index, ss = hex short session ID)

fixes bug #260 virtual interface names too long
(Boeing r1894)
This commit is contained in:
ahrenholz 2014-10-28 21:18:16 +00:00
parent 96dd48e3c3
commit 503713f0bc
3 changed files with 6 additions and 4 deletions

View file

@ -167,9 +167,9 @@ class SimpleLxcNode(PyCoreNode):
if ifname is None:
ifname = "eth%d" % ifindex
sessionid = self.session.shortsessionid()
name = "veth%s.%s.1.%s" % (self.objid, ifindex, sessionid)
name = "veth%s.%sp%s" % (self.objid, ifindex, sessionid)
localname = "veth%s.%s.%s" % (self.objid, ifindex, sessionid)
if len(ifname) > 16:
if len(localname) >= 16:
raise ValueError, "interface local name '%s' to long" % \
localname
ifclass = VEth