[eggheads-patches] PATCH1.4: detectnumhost_1.4.patch

Fabian Knittel fknittel at gmx.de
Mon Oct 11 03:03:10 CST 1999


[ detectnumhost_1.4.patch ]

This patch fixes (should fix) the problem reported by guppy
recently. Patch name says it all :)

Fabian
-------------- next part --------------
diff -urN eggdrop1.4~/doc/UPDATES1.4 eggdrop1.4/doc/UPDATES1.4
--- eggdrop1.4~/doc/UPDATES1.4	Mon Oct 11 04:00:26 1999
+++ eggdrop1.4/doc/UPDATES1.4	Mon Oct 11 09:23:42 1999
@@ -5,6 +5,7 @@
 
 1.4.0
 Foundby   Fixedby   What....
+guppy	  Fabian    numerical hostnames are now detected
 	  Fabian    outgoing bot links weren't correctly initialised, autolink
 		    wasn't detecting active bot links and the dns module was
 		    still broken from the last byte order changes
diff -urN eggdrop1.4~/src/dns.c eggdrop1.4/src/dns.c
--- eggdrop1.4~/src/dns.c	Mon Oct 11 04:00:27 1999
+++ eggdrop1.4/src/dns.c	Mon Oct 11 09:14:54 1999
@@ -157,6 +157,15 @@
 
 void block_dns_ipbyhost(char *host)
 {
+  struct in_addr inaddr;
+
+  context;
+  /* Check if someone passed us an IP address as hostname 
+   * and return it straight away */
+  if (inet_aton(host, &inaddr)) {
+    call_ipbyhost(host, my_ntohl(inaddr.s_addr), 1);
+    return;
+  }
   if (!setjmp(alarmret)) {
     struct hostent *hp;
     struct in_addr *in;
diff -urN eggdrop1.4~/src/mod/dns.mod/coredns.c eggdrop1.4/src/mod/dns.mod/coredns.c
--- eggdrop1.4~/src/mod/dns.mod/coredns.c	Mon Oct 11 04:00:27 1999
+++ eggdrop1.4/src/mod/dns.mod/coredns.c	Mon Oct 11 09:15:10 1999
@@ -1048,7 +1048,15 @@
 static void dns_forward(char *hostn)
 {
     struct resolve *rp;
-    
+    struct in_addr inaddr;
+
+    context;
+    /* Check if someone passed us an IP address as hostname 
+     * and return it straight away */
+    if (inet_aton(hostn, &inaddr)) {
+      call_ipbyhost(hostn, my_ntohl(inaddr.s_addr), 1);
+      return;
+    }
     context;
     if ((rp = findhost(hostn))) {
 	if ((rp->state == STATE_FINISHED)


More information about the Patches mailing list