Commit 4a3ed624 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

In case of make_ll64 fails return

Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent 3596e9b6
......@@ -283,6 +283,8 @@ class Subnet(object):
""" Compute an EUI-64 address from an EUI-48 (MAC) address
"""
if mac is None:
return None
comp = mac.split(":")
prefix = IPy.IP(net).net().strFullsize().split(":")[:4]
eui64 = comp[:3] + ["ff", "fe"] + comp[3:]
......@@ -681,6 +683,8 @@ class VMNetProxy(object): # pylint: disable=R0902
indevmac = self.get_iface_hw_addr(binding.indev)
ifll = subnet.make_ll64(indevmac)
if ifll is None:
return
resp = Ether(src=indevmac)/\
......@@ -742,6 +746,8 @@ class VMNetProxy(object): # pylint: disable=R0902
indevmac = self.get_iface_hw_addr(binding.indev)
ifll = subnet.make_ll64(indevmac)
if ifll is None:
return
if not (subnet.net.overlaps(ns.tgt) or str(ns.tgt) == str(ifll)):
logging.debug("Received NS for a non-routable IP (%s)", ns.tgt)
......@@ -783,6 +789,8 @@ class VMNetProxy(object): # pylint: disable=R0902
continue
indevmac = self.get_iface_hw_addr(indev)
ifll = subnet.make_ll64(indevmac)
if ifll is None:
continue
resp = Ether(src=indevmac)/\
IPv6(src=str(ifll))/ICMPv6ND_RA(routerlifetime=14400)/\
ICMPv6NDOptPrefixInfo(prefix=str(subnet.prefix),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment