+2005-03-07 Michael Poole <mdpoole@troilus.org>
+
+ * configure.in: Consistently use a constant in AC_DEFINE().
+
+ * configure: Regenerate.
+
+ * doc/example.conf (Port): Add comment about the mask option.
+ (Port): Fix the vhosted Port example.
+
+ * ircd/ircd_parser.y (clientblock): Correctly initialize the IP
+ address and addrbits for a Client block with no IP mask.
+
+ * ircd/match.c (ipmask_parse): Accept * as a zero-bit mask.
+
+ * ircd/s_auth.c (start_auth_query): Count socket allocation
+ failure as a failed auth check, as .11 does.
+
+ * ircd/s_debug.c (debug_serveropts): Add '6' to server options
+ when compiled with IPv6 support.
+
2005-02-23 Michael Poole <mdpoole@troilus.org>
* doc/example.conf: Explain apass_opmode privilege, pointing out
if test x"$unet_cv_enable_poll" = xyes; then
cat >>confdefs.h <<\_ACEOF
-#define USE_POLL
+#define USE_POLL 1
_ACEOF
ENGINE_C=engine_poll.c
if test x"$unet_cv_enable_debug" = xyes; then
cat >>confdefs.h <<\_ACEOF
-#define DEBUGMODE
+#define DEBUGMODE 1
_ACEOF
fi
if test x"$ac_cv_use_ipv6" != "xno" ; then
cat >>confdefs.h <<\_ACEOF
-#define IPV6
+#define IPV6 1
_ACEOF
fi
if test x"$unet_cv_enable_asserts" = xno; then
cat >>confdefs.h <<\_ACEOF
-#define NDEBUG
+#define NDEBUG 1
_ACEOF
fi
if test x"$unet_cv_enable_inlines" = xyes; then
cat >>confdefs.h <<\_ACEOF
-#define FORCEINLINE
+#define FORCEINLINE 1
_ACEOF
fi
if test x"$unet_cv_enable_devpoll" != xno; then
cat >>confdefs.h <<\_ACEOF
-#define USE_DEVPOLL
+#define USE_DEVPOLL 1
_ACEOF
ENGINE_C="engine_devpoll.c $ENGINE_C"
if test x"$unet_cv_enable_kqueue" != xno; then
cat >>confdefs.h <<\_ACEOF
-#define USE_KQUEUE
+#define USE_KQUEUE 1
_ACEOF
ENGINE_C="engine_kqueue.c $ENGINE_C"
echo "${ECHO_T}no" >&6
cat >>confdefs.h <<\_ACEOF
-#define EPOLL_NEED_BODY
+#define EPOLL_NEED_BODY 1
_ACEOF
fi
conftest$ac_exeext conftest.$ac_ext
cat >>confdefs.h <<\_ACEOF
-#define USE_EPOLL
+#define USE_EPOLL 1
_ACEOF
ENGINE_C="engine_epoll.c $ENGINE_C"
AC_MSG_RESULT([$unet_cv_enable_poll])
if test x"$unet_cv_enable_poll" = xyes; then
- AC_DEFINE([USE_POLL], , [Specify whether or not to use poll()])
+ AC_DEFINE([USE_POLL], 1, [Specify whether or not to use poll()])
ENGINE_C=engine_poll.c
else
ENGINE_C=engine_select.c
AC_MSG_RESULT([$unet_cv_enable_debug])
if test x"$unet_cv_enable_debug" = xyes; then
- AC_DEFINE([DEBUGMODE], , [Enable debugging code])
+ AC_DEFINE([DEBUGMODE], 1, [Enable debugging code])
fi
dnl Now look for --enable-leak-detect
[ac_cv_use_ipv6=$unet_have_sockaddr_in6])
AC_CACHE_CHECK([whether to use IPv6], [ac_cv_use_ipv6], [ac_cv_use_ipv6=no])
if test x"$ac_cv_use_ipv6" != "xno" ; then
- AC_DEFINE([IPV6], , [Enable IPv6 support])
+ AC_DEFINE([IPV6], 1, [Enable IPv6 support])
fi
dnl And now for --disable-asserts
AC_MSG_RESULT([$unet_cv_enable_asserts])
if test x"$unet_cv_enable_asserts" = xno; then
- AC_DEFINE([NDEBUG], , [Disable assertions])
+ AC_DEFINE([NDEBUG], 1, [Disable assertions])
fi
dnl Check for --enable-symbols
AC_MSG_RESULT([$unet_cv_enable_inlines])
if test x"$unet_cv_enable_inlines" = xyes; then
- AC_DEFINE([FORCEINLINE], , [Force inlining for a few critical functions])
+ AC_DEFINE([FORCEINLINE], 1, [Force inlining for a few critical functions])
fi
dnl --disable-devpoll check...
AC_MSG_RESULT([$unet_cv_enable_devpoll])
if test x"$unet_cv_enable_devpoll" != xno; then
- AC_DEFINE([USE_DEVPOLL], , [Define to enable the /dev/poll engine])
+ AC_DEFINE([USE_DEVPOLL], 1, [Define to enable the /dev/poll engine])
ENGINE_C="engine_devpoll.c $ENGINE_C"
fi
AC_MSG_RESULT([$unet_cv_enable_kqueue])
if test x"$unet_cv_enable_kqueue" != xno; then
- AC_DEFINE([USE_KQUEUE], , [Define to enable the kqueue engine])
+ AC_DEFINE([USE_KQUEUE], 1, [Define to enable the kqueue engine])
ENGINE_C="engine_kqueue.c $ENGINE_C"
fi
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/epoll.h>], [epoll_create(10);])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
- AC_DEFINE([EPOLL_NEED_BODY],,[Define to implement epoll system calls])])
- AC_DEFINE([USE_EPOLL], , [Define to enable the epoll engine])
+ AC_DEFINE([EPOLL_NEED_BODY], 1, [Define to implement epoll system calls])])
+ AC_DEFINE([USE_EPOLL], 1, [Define to enable the epoll engine])
ENGINE_C="engine_epoll.c $ENGINE_C"
fi
Port { port = 6667; };
Port { port = 6668; };
Port {
+ # This only accepts clients with IPs like 192.168.*.
mask = "192.168.*";
port = 6666;
};
-# This is a hidden client port, listening on the interface associated
-# with the IP address 168.8.21.107
+# This is a hidden client port, listening on 168.8.21.107.
Port {
- mask = "168.8.21.107";
+ vhost = "168.8.21.107";
hidden = yes;
port = 7000;
};
'{' clientitems '}' ';'
{
struct irc_in_addr addr;
- unsigned char addrbits;
+ unsigned char addrbits = 0;
if (ip && !ipmask_parse(ip, &addr, &addrbits)) {
parse_error("Invalid IP address in block");
struct ConfItem *aconf = make_conf(CONF_CLIENT);
aconf->username = username;
aconf->host = host;
- memcpy(&aconf->address.addr, &addr, sizeof(aconf->address.addr));
+ if (ip)
+ memcpy(&aconf->address.addr, &addr, sizeof(aconf->address.addr));
+ else
+ memset(&aconf->address.addr, 0, sizeof(aconf->address.addr));
aconf->addrbits = addrbits;
aconf->name = ip;
aconf->conn_class = c_class ? c_class : find_class("default");
mask->in6_16[5] = 0xffff;
memcpy(&mask->in6_16[6], &ipv4.s_addr, sizeof(ipv4.s_addr));
bits += 96;
+ } else if (in[0] == '*' && in[1] == '\0') {
+ /* accept as a 0-bit mask */
} else {
if (!(p = strchr(in, '/')))
bits = 128;
os_get_sockname(cli_fd(auth->client), &local_addr);
local_addr.port = 0;
fd = os_socket(&local_addr, SOCK_STREAM, "auth query");
- if (fd < 0)
+ if (fd < 0) {
+ ++ServerStats->is_abad;
return 0;
+ }
if (IsUserPort(auth->client))
sendheader(auth->client, REPORT_DO_ID);
memcpy(&remote_addr.addr, &cli_ip(auth->client), sizeof(remote_addr.addr));
#if defined(USE_POLL) && defined(HAVE_POLL_H)
AddC('U');
#endif
+#ifdef IPV6
+ AddC('6');
+#endif
serveropts[i] = '\0';