Fix a resolver crash and an v4-compatible address parsing crash.
authorMichael Poole <mdpoole@troilus.org>
Thu, 10 Feb 2005 03:25:40 +0000 (03:25 +0000)
committerMichael Poole <mdpoole@troilus.org>
Thu, 10 Feb 2005 03:25:40 +0000 (03:25 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1310 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/ircd_res.c
ircd/ircd_string.c
ircd/test/ircd_in_addr_t.c

index d1ce5403947cb73e5afb34d183c1a54213757182..692d9958fd57b7bcce34ca9ab93402033f589ed6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-02-09  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/ircd_res.c (check_resolver_timeout): Try another way to
+       avoid timer_chg() on a non-queued/active timer.
+
+       * ircd/ircd_string.c (ircd_aton): Set part_start to handle input
+       strings like "::127.0.0.1".
+
+       * ircd/test/ircd_in_addr_t.c (test_addrs): Add a test for that.
+
 2005-02-02  Michael Poole <mdpoole@troilus.org>
 
        * Makefile.in (install): Do not create ${prefix}/include since it
index e56c6cd9956a1af657788383a800ad8eb4d35368..6ed86662a255f19725ddbb6960715fcad8e922fc 100644 (file)
@@ -278,7 +278,7 @@ check_resolver_timeout(time_t when)
 {
   if (when > CurrentTime + AR_TTL)
     when = CurrentTime + AR_TTL;
-  if (!t_onqueue(&res_timeout))
+  if (!t_active(&res_timeout) || !t_onqueue(&res_timeout))
     timer_add(&res_timeout, timeout_resolver, NULL, TT_ABSOLUTE, when);
   else if (when < t_expire(&res_timeout))
     timer_chg(&res_timeout, TT_ABSOLUTE, when);
index fab7c715331c4c799de6055fa5f52daaa7157d3c..8f0cd09563cf6bb1b594382eedecafae8c4b06c5 100644 (file)
@@ -596,6 +596,7 @@ ircd_aton(struct irc_in_addr *ip, const char *input)
         return 0;
       colon = 0;
       pos += 2;
+      part_start = input + pos;
     }
     while (ii < 8) {
       unsigned char chval;
index 90dd3194318f3f18c35e8bd7b00712ac7c998b33..4694d67e995fcd5f22cf93d7a102dc670349cecd 100644 (file)
@@ -34,6 +34,9 @@ static struct address_test test_addrs[] = {
     { "::ffff:127.0.0.3", "127.0.0.3",
       {{ 0, 0, 0, 0, 0, 0xffff, 0x7f00, 3 }},
       "B]AAAD", "B]AAAD", 1, 1, 1 },
+    { "::127.0.0.1", "127.0.0.1",
+      {{ 0, 0, 0, 0, 0, 0, 0x7f00, 1 }},
+      "B]AAAB", "B]AAAB", 1, 1, 1 },
     { "2002:7f00:3::1", "2002:7f00:3::1",
       {{ 0x2002, 0x7f00, 3, 0, 0, 0, 0, 1 }},
       "B]AAAD", "CACH8AAAD_AAB", 1, 0, 0 },