• Ben Greear's avatar
    iproute2: Fix filtering related to flushing IP addresses. · 3bc1c4f2
    Ben Greear authored
    The old 'ip addr flush' logic had several flaws:
    
    * It reversed logic for primary v/s secondary flags
      (though, it sort of worked right anyway)
    
    * The code tried to remove secondaries and then primaries,
      but in practice, it always removed one primary per loop,
      which not at all efficient.
    
    * The filter logic in the core would run only the first
      filter in most cases.
    
    * If you used '-s -s', the ifa_flags member would be
      modified, which could make future filters fail
      to function fine.
    
    This patch attempts to fix all of these issues.
    Tested-by: default avatarBrian Haley <brian.haley@hp.com>
    Signed-off-by: default avatarBen Greear <greearb@candelatech.com>
    3bc1c4f2
ipaddress.c 32.3 KB