From ebb48a48081cf607e19117f3397c57b81987ea4d Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 27 Oct 2017 23:57:52 -0700 Subject: [PATCH] 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. --- src/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf.py b/src/conf.py index 9082ffdc0..840908df5 100644 --- a/src/conf.py +++ b/src/conf.py @@ -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)