Add a method to validate netmask. Invalidate-pull-request: #1831 #Add test cases Signed-off-by: Wang Sen <wangsen@linux.vnet.ibm.com>