add intf_addr_cmp function

In contrast to addr_cmp, intf_addr_cmp compares all bytes of an address
regardless of its netmask. This is useful for comparing interface addresses
which may be different but have the same netmask.