From f7b54461775608089f85f92e7438b615457cd359 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 3 Feb 2010 00:44:51 +0100 Subject: [PATCH] Apply ratbox3 workaround for too permissive inet_pton6(): Any kline (or various other things) containing * or ? is a mask kline and not an IP kline. Ideally, rb_inet_pton_sock() would return failure for those, but in practice this is not always the case for IPv6. Such a kline that is erroneously treated as an IP line likely matches way fewer IPs than expected. --- src/hostmask.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hostmask.c b/src/hostmask.c index aba2277..806ecb8 100644 --- a/src/hostmask.c +++ b/src/hostmask.c @@ -62,7 +62,11 @@ parse_netmask(const char *text, struct sockaddr *naddr, int *nb) addr = (struct rb_sockaddr_storage *)&xaddr; else addr = (struct rb_sockaddr_storage *)naddr; - + + if(strpbrk(ip, "*?") != NULL) + { + return HM_HOST; + } #ifdef RB_IPV6 if(strchr(ip, ':')) {