From fneves@foo.eng.br  Fri Jan 25 18:41:22 2002
Return-Path: <fneves@foo.eng.br>
Received: from fork.foo.eng.br (200-221-33-167.dsl-sp.uol.com.br [200.221.33.167])
	by hub.freebsd.org (Postfix) with ESMTP id 0695837B404
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Jan 2002 18:41:20 -0800 (PST)
Received: by fork.foo.eng.br (Postfix, from userid 1000)
	id CE1D98C24; Sat, 26 Jan 2002 00:41:15 -0200 (BRST)
Message-Id: <20020126024115.CE1D98C24@fork.foo.eng.br>
Date: Sat, 26 Jan 2002 00:41:15 -0200 (BRST)
From: Frederico A C Neves <fneves@registro.br>
Sender: fneves@foo.eng.br
Reply-To: Frederico A C Neves <fneves@registro.br>
To: FreeBSD-gnats-submit@freebsd.org
Cc: fneves@registro.br
Subject: whois client making recursive query on the same server 2 times
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34291
>Category:       bin
>Synopsis:       whois client making recursive query on the same server 2 times
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mike
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 25 18:50:01 PST 2002
>Closed-Date:    Mon Mar 11 18:16:17 PST 2002
>Last-Modified:  Mon Mar 11 18:17:03 PST 2002
>Originator:     Frederico A C Neves
>Release:        FreeBSD 4.5-RC i386
>Organization:
Registro.br
>Environment:
System: FreeBSD fork.foo.eng.br 4.5-RC FreeBSD 4.5-RC #0: Sun Jan 13 20:49:59 BRST 2002 root@fork.foo.eng.br:/usr/src/sys/compile/FORKH i386


	
>Description:

When the whois client receives a first answer of a query on the .BR whois 
server it detects the string "whois.registro.br" on the answer and make a
second recursive query on the same server. This feature was introduced to
follow a referral from the ARIN whois server and works for IPs but it will
make the same query 2 times for .BR domain names when the server is not
specified on the command line. The following patch prevents the client
from recur on the same server   

	
>How-To-Repeat:

Using this version of the whois client

 "$FreeBSD: src/usr.bin/whois/whois.c,v 1.15.2.7 2001/12/09 07:20:39
  mike Exp $";

try:

$ whois registro.br

	
>Fix:

*** whois.c_orig        Thu Jan 24 20:40:52 2002
--- whois.c     Thu Jan 24 20:34:00 2002
***************
*** 299,305 ****
                }
        }
        if (nhost != NULL) {
!               if ((res2 = gethostinfo(nhost, 0)) == NULL) {
                        free(nhost);
                        return;
                }
--- 299,307 ----
                }
        }
        if (nhost != NULL) {
!               if ((res2 = gethostinfo(nhost, 0)) == NULL ||
!                   (((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr ==
!                    ((struct sockaddr_in *)res2->ai_addr)->sin_addr.s_addr)) {
                        free(nhost);
                        return;
                }

	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mike 
Responsible-Changed-By: mike 
Responsible-Changed-When: Sat Jan 26 12:45:39 PST 2002 
Responsible-Changed-Why:  

Over to me. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34291 
State-Changed-From-To: open->analyzed 
State-Changed-By: mike 
State-Changed-When: Sat Feb 2 23:37:21 PST 2002 
State-Changed-Why:  

Fixed in -CURRENT.  The code was fixed by only recursively following 
ARIN referrals when querying ARIN.  MFC in 7 days. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34291 
State-Changed-From-To: analyzed->closed 
State-Changed-By: mike 
State-Changed-When: Mon Mar 11 18:16:17 PST 2002 
State-Changed-Why:  

This was fixed in -stable about a month ago. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34291 
>Unformatted:
