Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2005-03-07 21:12:50 UTC

Modified files:
     ChangeLog configure configure.in doc/example.conf
     ircd/ircd_parser.y ircd/match.c ircd/s_auth.c ircd/s_debug.c

Log message:

Add '6' to server options when compiled with IPv6 support (and related
configury changes that seem to be necessary).  Fix Port block docs.
Fix IP mask parsing (and mis-parsing) for Client blocks.  Count
failure to create an ident lookup socket in the statistics.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.561 ircu2.10/ChangeLog:1.562
--- ircu2.10/ChangeLog:1.561    Wed Feb 23 19:07:01 2005
+++ ircu2.10/ChangeLog  Mon Mar  7 13:11:49 2005
@@ -1,3 +1,23 @@
+2005-03-07  Michael Poole <[EMAIL PROTECTED]>
+
+       * 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 <[EMAIL PROTECTED]>
 
        * doc/example.conf: Explain apass_opmode privilege, pointing out
Index: ircu2.10/configure
diff -u ircu2.10/configure:1.28 ircu2.10/configure:1.29
--- ircu2.10/configure:1.28     Wed Feb  9 19:51:29 2005
+++ ircu2.10/configure  Mon Mar  7 13:12:08 2005
@@ -9300,7 +9300,7 @@
 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
@@ -9329,7 +9329,7 @@
 if test x"$unet_cv_enable_debug" = xyes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define DEBUGMODE
+#define DEBUGMODE 1
 _ACEOF
 
 fi
@@ -9380,7 +9380,7 @@
 if test x"$ac_cv_use_ipv6" != "xno" ; then
 
 cat >>confdefs.h <<\_ACEOF
-#define IPV6
+#define IPV6 1
 _ACEOF
 
 fi
@@ -9405,7 +9405,7 @@
 if test x"$unet_cv_enable_asserts" = xno; then
 
 cat >>confdefs.h <<\_ACEOF
-#define NDEBUG
+#define NDEBUG 1
 _ACEOF
 
 fi
@@ -9514,7 +9514,7 @@
 if test x"$unet_cv_enable_inlines" = xyes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define FORCEINLINE
+#define FORCEINLINE 1
 _ACEOF
 
 fi
@@ -9544,7 +9544,7 @@
 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"
@@ -9575,7 +9575,7 @@
 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"
@@ -9652,7 +9652,7 @@
 echo "${ECHO_T}no" >&6
 
 cat >>confdefs.h <<\_ACEOF
-#define EPOLL_NEED_BODY
+#define EPOLL_NEED_BODY 1
 _ACEOF
 
 fi
@@ -9660,7 +9660,7 @@
       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"
Index: ircu2.10/configure.in
diff -u ircu2.10/configure.in:1.27 ircu2.10/configure.in:1.28
--- ircu2.10/configure.in:1.27  Wed Feb  9 19:51:31 2005
+++ ircu2.10/configure.in       Mon Mar  7 13:12:20 2005
@@ -19,7 +19,7 @@
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 dnl
-dnl $Id: configure.in,v 1.27 2005/02/10 03:51:31 entrope Exp $
+dnl $Id: configure.in,v 1.28 2005/03/07 21:12:20 entrope Exp $
 
 dnl Make sure we are in the correct directory (someone could have run
 dnl 'configure' with a wrong '--srcdir').
@@ -249,7 +249,7 @@
 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
@@ -266,7 +266,7 @@
 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
@@ -292,7 +292,7 @@
     [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
@@ -305,7 +305,7 @@
 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
@@ -370,7 +370,7 @@
 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...
@@ -388,7 +388,7 @@
 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
 
@@ -407,7 +407,7 @@
 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
 
@@ -432,8 +432,8 @@
     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
 
Index: ircu2.10/doc/example.conf
diff -u ircu2.10/doc/example.conf:1.46 ircu2.10/doc/example.conf:1.47
--- ircu2.10/doc/example.conf:1.46      Wed Feb 23 19:07:01 2005
+++ ircu2.10/doc/example.conf   Mon Mar  7 13:12:21 2005
@@ -692,14 +692,14 @@
 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;
 };
Index: ircu2.10/ircd/ircd_parser.y
diff -u ircu2.10/ircd/ircd_parser.y:1.40 ircu2.10/ircd/ircd_parser.y:1.41
--- ircu2.10/ircd/ircd_parser.y:1.40    Wed Feb 23 19:07:03 2005
+++ ircu2.10/ircd/ircd_parser.y Mon Mar  7 13:12:35 2005
@@ -17,7 +17,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  *  USA.
- * $Id: ircd_parser.y,v 1.40 2005/02/24 03:07:03 entrope Exp $
+ * $Id: ircd_parser.y,v 1.41 2005/03/07 21:12:35 entrope Exp $
  */
 %{
 
@@ -652,7 +652,7 @@
 '{' 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");
@@ -663,7 +663,10 @@
     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");
Index: ircu2.10/ircd/match.c
diff -u ircu2.10/ircd/match.c:1.12 ircu2.10/ircd/match.c:1.13
--- ircu2.10/ircd/match.c:1.12  Tue Dec 28 14:31:57 2004
+++ ircu2.10/ircd/match.c       Mon Mar  7 13:12:37 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Functions to match strings against IRC mask strings.
- * @version $Id: match.c,v 1.12 2004/12/28 22:31:57 entrope Exp $
+ * @version $Id: match.c,v 1.13 2005/03/07 21:12:37 entrope Exp $
  */
 #include "config.h"
 
@@ -905,6 +905,8 @@
     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;
Index: ircu2.10/ircd/s_auth.c
diff -u ircu2.10/ircd/s_auth.c:1.34 ircu2.10/ircd/s_auth.c:1.35
--- ircu2.10/ircd/s_auth.c:1.34 Fri Jan 21 14:52:22 2005
+++ ircu2.10/ircd/s_auth.c      Mon Mar  7 13:12:37 2005
@@ -27,7 +27,7 @@
  */
 /** @file
  * @brief Implementation of DNS and ident lookups.
- * @version $Id: s_auth.c,v 1.34 2005/01/21 22:52:22 entrope Exp $
+ * @version $Id: s_auth.c,v 1.35 2005/03/07 21:12:37 entrope Exp $
  */
 #include "config.h"
 
@@ -422,8 +422,10 @@
   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));
Index: ircu2.10/ircd/s_debug.c
diff -u ircu2.10/ircd/s_debug.c:1.35 ircu2.10/ircd/s_debug.c:1.36
--- ircu2.10/ircd/s_debug.c:1.35        Fri Dec 10 21:14:04 2004
+++ ircu2.10/ircd/s_debug.c     Mon Mar  7 13:12:39 2005
@@ -19,7 +19,7 @@
  */
 /** @file
  * @brief Debug support for the ircd.
- * @version $Id: s_debug.c,v 1.35 2004/12/11 05:14:04 klmitch Exp $
+ * @version $Id: s_debug.c,v 1.36 2005/03/07 21:12:39 entrope Exp $
  */
 #include "config.h"
 
@@ -109,6 +109,9 @@
 #if defined(USE_POLL) && defined(HAVE_POLL_H)
   AddC('U');
 #endif
+#ifdef  IPV6
+  AddC('6');
+#endif
 
   serveropts[i] = '\0';
 
----------------------- End of diff -----------------------

Reply via email to