return True
mac = mac.lower()
try:
- if int(mac.split(":")[0][1], 16) & 1 :
+ if int(mac.split(":")[0], 16) & 1 :
self.logger.error("%s: Multicast bit is set in the virtual mac address '%s'" %(ifaceobj.name, mac))
return False
return True
try:
master = self.ipcmd.link_get_master(ifaceobj.name)
if not master or master != vrf:
- ifaceobjcurr.update_config_with_status('vrf', master, 1)
+ ifaceobjcurr.update_config_with_status('vrf', str(master), 1)
else:
ifaceobjcurr.update_config_with_status('vrf', master, 0)
except Exception, e:
[linkCache.update_attrdict([ifname], linkattrs)
for ifname, linkattrs in linkout.items()]
- def _addr_filter(self, addr, scope=None):
+ def _addr_filter(self, ifname, addr, scope=None):
default_addrs = ['127.0.0.1/8', '::1/128' , '0.0.0.0']
- if addr in default_addrs:
+ if ifname == 'lo' and addr in default_addrs:
return True
if scope and scope == 'link':
return True
except KeyError:
linkout[ifname] = linkattrs
if citems[2] == 'inet':
- if self._addr_filter(citems[3], scope=citems[5]):
+ if self._addr_filter(citems[3], ifname, scope=citems[5]):
continue
addrattrs = {}
addrattrs['scope'] = citems[5]
addrattrs['type'] = 'inet'
linkout[ifname]['addrs'][citems[3]] = addrattrs
elif citems[2] == 'inet6':
- if self._addr_filter(citems[3], scope=citems[5]):
+ if self._addr_filter(citems[3], ifname, scope=citems[5]):
continue
if citems[5] == 'link': continue #skip 'link' addresses
addrattrs = {}