conf: fix validation of multiple IP addresses

Previously, setting supybot.servers.http.hosts6 to multiple IP addresses always
failed because utils.net.isIPV6() gets passed a string with a space in it.
This code worked however for multiple IPv4 addresses because inet_aton(), which
is used internally by isIPV4(), allows and ignores trailing data after the
first IP address it finds.

Thanks to @MrBenC for reporting.
This commit is contained in:
James Lu 2017-10-27 23:57:52 -07:00
parent e05f1ae5df
commit ebb48a4808
1 changed files with 1 additions and 1 deletions

View File

@ -1241,7 +1241,7 @@ registerGroup(supybot.servers, 'http')
class IP(registry.String):
"""Value must be a valid IP."""
def setValue(self, v):
if v and not utils.net.isIP(v):
if v and not all(map(utils.net.isIP, v.split())):
self.error()
else:
registry.String.setValue(self, v)