fixes #7430 - Adds subnet mask validation

Please use ```refute``` instead of ```assert !```