original_docstring: Remove multicast hardware addresses from the database
docstring: Remove multicast hardware addresses from the database
docstring_tokens: Remove multicast hardware addresses from the database
code: def remove_multicast_addresses(self):
          """Remove multicast hardware addresses from the database"""
          keys_to_remove = set()
          for hw_addr, ips in self.ip_for_hw.items():
              if hw_addr.startswith('01:00:5e:'):  # IPv4 multicast, 224.0.0.0/4 (until 239.255.255.255)
                  for ip in list(ips):
                      if 224 <= int(ip.split('.', 1)[0]) <= 239:
                          logger.debug("Removing IPv4 multicast address %s (%s)", ip, hw_addr)
                          ips.remove(ip)
              if hw_addr.startswith('33:33:'):  # IPv6 multicast, ff00::/12
                  for ip in list(ips):
                      if re.match(r'^ff0[0-9a-f]:', ip, re.I):
                          logger.debug("Removing IPv6 multicast address %s (%s)", ip, hw_addr)
                          ips.remove(ip)
              if not ips:
                  keys_to_remove.add(hw_addr)
          for hw_addr in keys_to_remove:
              del self.ip_for_hw[hw_addr]
code_tokens: def remove_multicast_addresses ( self ) : keys_to_remove = set ( ) for hw_addr , ips in self . ip_for_hw . items ( ) : if hw_addr . startswith ( '01:00:5e:' ) : for ip in list ( ips ) : if 224 <= int ( ip . split ( '.' , 1 ) [ 0 ] ) <= 239 : logger . debug ( "Removing IPv4 multicast address %s (%s)" , ip , hw_addr ) ips . remove ( ip ) if hw_addr . startswith ( '33:33:' ) : for ip in list ( ips ) : if re . match ( r'^ff0[0-9a-f]:' , ip , re . I ) : logger . debug ( "Removing IPv6 multicast address %s (%s)" , ip , hw_addr ) ips . remove ( ip ) if not ips : keys_to_remove . add ( hw_addr ) for hw_addr in keys_to_remove : del self . ip_for_hw [ hw_addr ]
short_docstring: Remove multicast hardware addresses from the database
short_docstring_tokens: Remove multicast hardware addresses from the database
comment: """Remove multicast hardware addresses from the database"""$SEP$# IPv4 multicast, 224.0.0.0/4 (until 239.255.255.255)$SEP$# IPv6 multicast, ff00::/12