-- Returns the mask portion of a CIDR address. That is, everything
-- after the trailing slash.
maskbits_from_cidr_string :: String -> Maskbits
-maskbits_from_cidr_string s =
- maskbits_from_string ((splitWith (`elem` "/") s) !! 1)
+maskbits_from_cidr_string s
+ | length partlist == 2 = maskbits_from_string (partlist !! 1)
+ | otherwise = Maskbits.None
+ where
+ partlist = (splitWith (`elem` "/") s)
-- Takes an IP address String in CIDR notation, and returns a list of