The Unknown BloggerRamblings of sorts
hgchew
read my profile
sign my guestbook

Visit hgchew's Xanga Site!

Country: Australia
Metro: Adelaide
Birthday: 12/29/1973
Gender: Male


Message: message meEmail: email me
Website: visit my website
ICQ: 6081422
MSN: hgchew@hotmail.com


Member Since: 8/7/2004

SubscriptionsSites I Read
tehsipeng
dawn_min
kArLiE_Y
c_t_h
Joanne_Chong
Azeldust
fly_pig

Posting Calendar

|<< oldest | newest >>|
view all weblog archives

Get Involved!

Suggest a link

Recommend to friend

Create a site


Friday, August 14, 2009

hybrid-ircd-7.2.3 Error durring DNS lookup

I have found a bug where Connect fails with "Error during DNS lookup".
It occurs on a IPv6 host connecting to a IPv4 host.  Even if the destination server has "aftype = ipv4", the originating server still tries to a AAAA lookup on the hostname.

res_readreply in irc_res.c does have a fall back to REQ_A when REQ_AAAA fails, however, that code isn't executed because it looks for rcode == NXDOMAIN when REQ_AAAA fails.  Many name servers now do not return NXDOMAIN, but just an empty reply, so that condition needs to be changed to include an empty reply.

The patch for 7.2.3 is given below.

------------------------------------------
> diff -Naur ircd-hybrid-7.2.3/src/irc_res.c.ori ircd-hybrid-7.2.3/src/irc_res.c
--- ircd-hybrid-7.2.3/src/irc_res.c.ori 2009-08-14 15:22:34.282642739 +0930
+++ ircd-hybrid-7.2.3/src/irc_res.c     2009-08-14 17:23:56.660657959 +0930
@@ -813,7 +813,7 @@

   if ((header->rcode != NO_ERRORS) || (header->ancount == 0))
   {
-    if (NXDOMAIN == header->rcode)
+    if (NXDOMAIN == header->rcode || (header->ancount == 0))
     {
       /*
        * If we havent already tried this, and we're looking up AAAA, try A


Wednesday, May 16, 2007

Updated hybserv patch

$ diff -p hybserv-1.9.3/src/nickserv.c.ori hybserv-1.9.3/src/nickserv.c
*** hybserv-1.9.3/src/nickserv.c.ori    2006-11-02 20:30:39.000000000 +1030
--- hybserv-1.9.3/src/nickserv.c        2007-05-16 22:21:39.000000000 +0930
*************** collide(char *nick, int dopseudo)
*** 1471,1477 ****
 
  #if defined SVSNICK || defined FORCENICK
        struct Luser *lsptr = NULL;
!       char newnick[NICKLEN + 1];
        long nicknum;
        int base;
        int i;
--- 1471,1477 ----
 
  #if defined SVSNICK || defined FORCENICK
        struct Luser *lsptr = NULL;
!       char newnick[NICKLEN + 10];
        long nicknum;
        int base;
        int i;
*************** collide(char *nick, int dopseudo)
*** 1499,1504 ****
--- 1499,1510 ----
 
  #if defined SVSNICK || defined FORCENICK
        if (!(lptr->flags & UMODE_NOFORCENICK))
+       /* Check if the existing nick is already prefixed */
+ #ifdef SVSNICK
+       if (ircncmp(lptr->nick, SVSNICK_PREFIX, strlen(SVSNICK_PREFIX)))
+ #else
+       if (ircncmp(lptr->nick, FORCENICK_PREFIX, strlen(FORCENICK_PREFIX)))
+ #endif
        {
                lptr->flags |= UMODE_NOFORCENICK;
                if (nptr != NULL)
*************** collide(char *nick, int dopseudo)
*** 1507,1551 ****
                        nptr->collide_ts = current_ts + 30;
                }
 
-               nicknum = random();
-
-       /*
-        * calculate how many chars do we need to pad
-        */
- #if defined SVSNICK
- #if defined SVSNICK_LEN
-
-               base = SVSNICK_LEN;
- #else
-
-               base = NICKLEN - strlen(SVSNICK_PREFIX);
- #endif
- #endif /* SVSNICK */
-
- #if defined FORCENICK
- #if defined FORCENICK_LEN
-
-               base = FORCENICK_LEN;
- #else
-
-               base = NICKLEN - strlen(FORCENICK_PREFIX);
- #endif
- #endif /* FORCENICK */
-
-               /* do the padding */
-               j = 1;
-               for (i = 1; i <= base; ++i)
-                       j *= 10;
-               nicknum %= j;
-
  #ifdef SVSNICK
 
!               ircsprintf(newnick, "%s%ld", SVSNICK_PREFIX, nicknum);
                toserv(":%s SVSNICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
  #else /* defined FORCENICK */
 
!               ircsprintf(newnick, "%s%ld", FORCENICK_PREFIX, nicknum);
                toserv(":%s FORCENICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
  #endif
--- 1513,1526 ----
                        nptr->collide_ts = current_ts + 30;
                }
 
  #ifdef SVSNICK
 
!               ircsprintf(newnick, "%s%s", SVSNICK_PREFIX, lptr->nick);
                toserv(":%s SVSNICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
  #else /* defined FORCENICK */
 
!               ircsprintf(newnick, "%s%s", FORCENICK_PREFIX, lptr->nick);
                toserv(":%s FORCENICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
  #endif


Tuesday, December 19, 2006

Simple bug in rrd.cgi

I have found a bug with rrd.cgi.
                                                                               
If the StatName ($item) has the directory ($item{directory}) as part of its name, then the resulting html page would be incorrect.  It can be fixed by removing the global (g) option.  I think only the first occurrence needs to be removed, rather than all.
                                                                               
eg:
Directory[item1-stat]:    item1
$item will become '-stat' instead of 'item1-stat'.
--- rrd.cgi.ori 2006-12-08 18:40:37.000000000 +1030
+++ rrd.cgi     2006-12-13 16:12:24.000000000 +1030
@@ -1288,7 +1288,7 @@
                     # anonymous hash and push onto the array @graphs
             my $item_relative = $item;
             # strip any directories from $item
-            $item_relative =~ s/$targets{$item}{directory}\/?//g;
+            $item_relative =~ s/$targets{$item}{directory}\/?//;
             push @graphs, {item => $item_relative, name => $itemname};
             if( (exists $targets{$item}{suppress} &&
                     $targets{$item}{suppress} =~ /d/ &&


Saturday, May 20, 2006

Something close, something blue; Something true, something crue'l....

ÄêÉÙ¶þÈË×é

·½¾¼ïÙ, »ÆÆôÃú

ÇúÃû£ºJust One Moment

¸èÊÖ£ºÄêÉÙ¶þÈË×é

°®×ÜÊÇÈÃÎÒʧȥ·½Ïò
Äã×ÜÊdzöÏÖÔÚÎÒÃÎÀï
¿´×ÅÄã¹À¼Æ×ÅÎÒÃǵľàÀë
ÆÈÇÐÏë°®ÄãµÄÐÄÔõÄÜÀä¾²
I Just Wanna See You For One Moment
¿ÊÍûµÃµ½ÄãµÄÒ»¸öÎÇ
¾ÍËãÒ»Çв»¿ÉÄÜ
ÎÒµÄÐÄÒ²²»»á±äÀä
I Just Wanna See You For One Moment
¿ÊÍûµÃµ½ÄãµÄÒ»¸öÎÇ
°ÑÕâÒ»¿Ìµ±³ÉÓÀºã
ÔÚÎÒÐÄÀïÃæ¾ÍÒѾ­ÍêÕû
˼ÄîÔÚÿ¸öÒ¹ÀïÆð·ü
ºöÈ»¿ÊÍûÓµ±§µÄζÈ
Îҵİ®ÇéÒѾ­²»±»ÄãÕ÷·þ


Thursday, February 23, 2006

hybserv path to prefix nick on collision

--- hybserv-1.9.1/src/nickserv.c        2006-02-23 21:18:20.000000000 +1030
+++ hybserv-1.9.1/src/nickserv.c.ori    2006-02-23 15:52:54.000000000 +1030
@@ -1383,14 +1383,17 @@
 
 {
   struct Luser *lptr = NULL;
-  char newnick[NICKLEN + 10];
+#if defined SVSNICK || defined FORCENICK
+  char newnick[NICKLEN + 1];
   long nicknum;
   int base;
   int i;
   int j;
+#else
   char **av;
   char sendstr[MAXLINE + 1];
   struct NickInfo *nptr = NULL;
+#endif
 
   if (!SafeConnect)
     return;
@@ -1431,7 +1434,7 @@
   ircsprintf(sendstr, "NICK %s 1 1 +i %s %s %s %lu :%s\r\n", lptr->nick,
       "enforced", Me.name, Me.name, 0xffffffffUL, "Nickname Enforcement");
 
-#else
+#elif !defined SVSNICK && !defined FORCENICK
 
   ircsprintf(sendstr, "NICK %s 1 %ld +i %s %s %s :%s\r\n",
       lptr->nick, (long) (lptr->nick_ts - 1), "enforced", Me.name,
@@ -1441,22 +1444,17 @@
 
   /* nope, we won't use ghosted nicknames, instead we'll force nick change
    * on remote nickname using SVSNICK or FORCENICK */
-
-#if defined SVSNICK || defined FORCENICK
-  if (ircncmp(lptr->nick, SVSNICK_PREFIX, strlen(SVSNICK_PREFIX))) {
 #ifdef SVSNICK
 
-    ircsprintf(newnick, "%s%s", SVSNICK_PREFIX, lptr->nick);
-    toserv(":%s SVSNICK %s %s\r\n", Me.name, lptr->nick, newnick);
+  ircsprintf(newnick, "%s%ld", SVSNICK_PREFIX, nicknum);
+  toserv(":%s SVSNICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
 #elif defined FORCENICK
 
-    ircsprintf(newnick, "%s%s", FORCENICK_PREFIX, lptr->nick);
-    toserv(":%s FORCENICK %s %s\r\n", Me.name, lptr->nick, newnick);
+  ircsprintf(newnick, "%s%ld", FORCENICK_PREFIX, nicknum);
+  toserv(":%s FORCENICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
-#endif
-  } else {
-#endif
+#else
 
   /* Sending a server kill will be quieter than an oper
    * kill since most clients are -k */
@@ -1481,8 +1479,6 @@
       nptr->flags &= ~(NS_COLLIDE | NS_NUMERIC);
       nptr->flags |= NS_RELEASE;
     }
-#if defined SVSNICK || defined FORCENICK
-  }
 #endif
 } /* collide() */
 



Next 5 >>

Random Thoughts

KoreanJapaneseAnime
What Happened in Bali,
Thousand Years of Love,
All about Eve,
Sand Glass, (The Hourglass)
Bodigadeu,
All In,
Propose,
Love Letter,
My Love Patzzi,
Stairway to Heaven,
Sweet 18
Trick,
Pretty Girls,
Asunaro Hakusho,
Maria,
Seija no Koushin,
101st Marriage Proposal,
Shopping Hero,
My Little Chef,
With Love,
Forbidden Love,
Heaven's Coin,
Food Fight,
Mukodono,
News no Onna,
Konna Koi no Hanashi,
Love & Fight,
Love Generation
Elfen Lied,
Emma,
Air,
Initial D,
Naruto,
Prince of Tennis,
Tenshi no Konamaiki,
Yawara
Site Meter