Hi,
there is a small issue in how the netmask is parsed (actually, an
undocumented feature which would allow this to be used for IPv6 is broken),
see attached patch. Problem is that inet_aton (at least on my Linux box)
kind of succeeds if it is just passed a number (instead of an IP address).
Christof
--
http://cmeerw.org sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org
diff -ur jabberd-2.1.16.orig/util/access.c jabberd-2.1.16/util/access.c
--- jabberd-2.1.16.orig/util/access.c 2006-04-16 22:42:32.000000000 +0200
+++ jabberd-2.1.16/util/access.c 2007-09-23 21:31:26.000000000 +0200
@@ -44,7 +44,11 @@
struct in_addr legacy_mask;
int netsize;
- if(inet_aton(mask, &legacy_mask))
+#ifndef HAVE_INET_PTON
+ if(strchr(mask, '.') && inet_aton(mask, &legacy_mask))
+#else
+ if(inet_pton(AF_INET, mask, &legacy_mask.s_addr) > 0)
+#endif
{
/* netmask has been given in dotted decimal form */
int temp = ntohl(legacy_mask.s_addr);
_______________________________________________
Jabberd2 mailing list
[email protected]
http://lists.xiaoka.com/listinfo.cgi/jabberd2-xiaoka.com