As part of #26, we should include some kind of implementation for C-VALIDATE in all of the methods that require the NetAddr to be fully masked.
The worst case I can think of is a NetAddr that isn't masked, which doesn't really cause any harm as masking usually happens regardless. But, if somehow memory gets corrupted and a mask changes, the NetAddr's addr might be wrong. (Think: unsafeness through FFI or something ridiculous like that.)
I think it's sufficient to add debug_assert!'s. Could also add a feature for checks which would be on by default.
Worth some thinking.
As part of #26, we should include some kind of implementation for
C-VALIDATEin all of the methods that require theNetAddrto be fully masked.The worst case I can think of is a
NetAddrthat isn't masked, which doesn't really cause any harm as masking usually happens regardless. But, if somehow memory gets corrupted and a mask changes, theNetAddr's addr might be wrong. (Think: unsafeness through FFI or something ridiculous like that.)I think it's sufficient to add
debug_assert!'s. Could also add a feature forcheckswhich would be on by default.Worth some thinking.