]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
Merge branch 'master-next' into python3
authorJulien Fortin <julien@cumulusnetworks.com>
Mon, 24 Feb 2020 13:17:57 +0000 (14:17 +0100)
committerJulien Fortin <julien@cumulusnetworks.com>
Mon, 24 Feb 2020 13:17:57 +0000 (14:17 +0100)
* master-next:
  nlpacket: don't raise an exception on 24 bytes mac address (#140)

1  2 
ifupdown2/nlmanager/nlpacket.py

index 3dd31513fd7e46b137804b79a7e375e7767f1a71,0d218194dee3fe1288c5de16b450ea47b4499304..eed90d58c8332b17e0247f0f6de0a4f629096512
@@@ -1438,10 -1476,12 +1438,11 @@@ class AttributeMACAddress(Attribute)
                  self.value = mac_int_to_str(self.raw)
              # GREv6 interface uses a 16-byte IP address for this attribute
              elif self.length == 20:
 -                self.value = IPv6Address(unpack('>L', self.data[16:])[0])
 -                self.value_int = int(self.value)
 -                self.value_int_str = str(self.value_int)
 +                self.value = ipnetwork.IPNetwork(unpack('>L', self.data[16:])[0])
 +
              else:
-                 raise Exception("Length of MACAddress attribute not supported: %d" % self.length)
+                 self.log.info("Length of MACAddress attribute not supported: %d" % self.length)
+                 self.value = None
  
          except struct.error:
              self.log.error("%s unpack of %s failed, data 0x%s" % (self, self.PACK, hexlify(self.data[4:])))