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

@ -689,7 +689,8 @@ class Session(object):
''' Return a shorter version of the session ID, appropriate for
interface names, where length may be limited.
'''
return (self.sessionid >> 8) ^ (self.sessionid & ((1 << 8) - 1))
ssid = (self.sessionid >> 8) ^ (self.sessionid & ((1 << 8) - 1))
return "%x" % ssid
def sendnodeemuid(self, handler, nodenum):
''' Send back node messages to the GUI for node messages that had