I revised this MR to cherrypick the only thing that was really important: the checks on Ipv4Mask.
The use case is... ME, myself, and I. I keep writing Ipv4Mask(24), forgetting that the c'tor doesn't want the mask length, it wants the mask, i.e., Ipv4Mask(oxFFFFFF00).