macvlan: Use 'hash' iterators to simplify code