Skip to content
  • Thomas Haller's avatar
    libnm: minor refactoring of _nm_utils_bridge_vlan_verify_list() · a358da09
    Thomas Haller authored and Beniamino Galvani's avatar Beniamino Galvani committed
    - if there is only one vlan in the list, then we can return success
      early. That is, because one NMBridgeVlan instance is always valid
      due to the way how users must use the API to construct the element.
    
    - the implementation for check_normalizable is only correct, if there
      are no duplicate or overlapping ranges. Assert for that. In fact,
      all callers first check for errors and then for normalizable errors.
    
    - avoid duplicate calls to nm_bridge_vlan_get_vid_range(). There are
      duplicate assertions that we don't need.
    
    - only check for pvid once per range.
    
    - combine calls to g_hash_table_contains() and g_hash_table_add().
    a358da09