Commit 824aaeab authored by Nikos Skalkotos's avatar Nikos Skalkotos

Merge branch 'hotfix-0.12.4'

parents d5e2dde2 c62abdba
......@@ -41,7 +41,7 @@ master_doc = 'index'
# General information about the project.
project = u'nfdhcpd'
copyright = u'2010-2013, GRNET S.A. All rights reserved'
copyright = u'2010-2016, GRNET S.A. All rights reserved'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......@@ -50,7 +50,7 @@ copyright = u'2010-2013, GRNET S.A. All rights reserved'
# The short X.Y version.
version = '0.12'
# The full version, including alpha/beta/rc tags.
release = '0.12.3'
release = '0.12.4'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -126,6 +126,26 @@ DHCP_REQRESP = {
DHCPINFORM: DHCPACK,
}
def ipv62mac(ipv6):
# remove subnet info if given
subnetIndex = ipv6.find("/")
if subnetIndex != -1:
ipv6 = ipv6[:subnetIndex]
ipv6Parts = ipv6.split(":")
macParts = []
for ipv6Part in ipv6Parts[-4:]:
while len(ipv6Part) < 4:
ipv6Part = "0" + ipv6Part
macParts.append(ipv6Part[:2])
macParts.append(ipv6Part[-2:])
# modify parts to match MAC value
macParts[0] = "%02x" % (int(macParts[0], 16) ^ 2)
del macParts[4]
del macParts[3]
return ":".join(macParts)
def get_indev(payload):
try:
......@@ -790,9 +810,9 @@ class VMNetProxy(object): # pylint: disable=R0902
pkt = IPv6(payload.get_data())
#logging.debug(pkt.show())
try:
mac = pkt.lladdr
mac = ipv62mac(pkt.src)
except:
logging.debug(" - RS: Cannot obtain lladdr")
logging.debug(" - RS: Cannot obtain MAC")
return
indev = get_indev(payload)
......
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