tjguk / networkzero

Making it easy for teachers to use simple networking in Python
MIT License
47 stars 14 forks source link

Improve valid IP pattern check #32

Closed geokala closed 8 years ago

geokala commented 8 years ago

I still feel like there may be improvements that can be made, but this at least checks whether the address is valid (without using regexes).

Note that socket.inet_aton automatically expands the converted IP (at least on linux).

Using socket.inet_pton would be better, but wouldn't support the wildcards the way they're written.

tjguk commented 8 years ago

Thanks, @geokala