general ipv6 infra with optional net_bits and Yaroslav's special

How about renaming net_bits to net_mask or mask?