提交 d682a0aa 编写于 作者: G Guillaume Nault 提交者: Dmitry Kozlov

iprange: warn before disabling module due to /0 network with non-null IP

Using a /0 prefix on an IP different from 0.0.0.0 is valid, but might
be a configuration mistake. Log warning message in this case so that
user can easily troubleshoot it.
Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
上级 ff2000c2
......@@ -114,8 +114,12 @@ static int parse_iprange(const char *str, struct iprange_t **range)
}
/* Interpret /0 as disable request */
if (prefix_len == 0)
if (prefix_len == 0) {
if (ipmin != INADDR_ANY)
log_warn("iprange: %s is equivalent to 0.0.0.0/0 and disables the iprange module\n",
str);
goto disable;
}
mask = INADDR_BROADCAST << (32 - prefix_len);
if (ipmin != (ipmin & mask)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册