diff --git a/docs/conf.py b/docs/conf.py index 41cb872f35c6bcf4d9bf5a491cbbdd3660490433..434408e70a54a016447feb89b7833f95d4cc16d9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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. diff --git a/nfdhcpd b/nfdhcpd index 25b4a96fd2c57d91a1e48f2b47393e5e4c89b8d5..af68aabf58b7b83d241f212ad9766153be1e1c90 100755 --- a/nfdhcpd +++ b/nfdhcpd @@ -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) diff --git a/version b/version index aa22d3ce39b25494fdac9adc19f0b4e7ca9cb493..e01e0ddd8e8b9610aceb704674fbfeab283080fd 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.12.3 +0.12.4