[ipv6] Add a dedicated function for prefix matching