NetBSD Problem Report #22475

Received: (qmail 676 invoked by uid 605); 14 Aug 2003 08:22:34 -0000
Message-Id: <20030814082229.20660.qmail@g.primenet.com.au>
Date: 14 Aug 2003 18:22:29 +1000
From: gcw@primenet.com.au
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: gcw@primenet.com.au
To: gnats-bugs@gnats.netbsd.org
Subject: patch to get net/ipw mostly working again
X-Send-Pr-Version: 3.95

>Number:         22475
>Category:       pkg
>Synopsis:       get net/ipw mostly working again
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    agc
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 14 08:23:00 +0000 2003
>Closed-Date:    Mon Dec 15 17:03:22 +0000 2003
>Last-Modified:  Mon Dec 15 17:04:00 +0000 2003
>Originator:     Geoff C. Wing
>Release:        NetBSD 1.6W
>Organization:
Geoff Wing : <gcw@pobox.com>
Rxvt Stuff : <gcw@rxvt.org>
Zsh Stuff  : <gcw@zsh.org>
>Environment:
System: NetBSD g.primenet.com.au 1.6W NetBSD 1.6W (G) #0: Mon Aug 4 10:11:19 EST 2003 gcw@g.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/G i386
Architecture: i386
Machine: i386
>Description:
	Due to changes in ARIN whois response (around a year ago), the ipw
	package has been (mostly) useless since then.  The patch provides
	basic functionality again.

>How-To-Repeat:

>Fix:
--- ipw.c.orig	1999-03-30 17:04:12.000000000 +1000
+++ ipw.c	2003-08-14 18:08:26.000000000 +1000
@@ -782,7 +782,7 @@
   if (!p)
     return NULL;

-  for (q = p + rwhois_prefix_len; *q && !isspace (*q); q++)
+  for (q = p + rwhois_prefix_len; *q && !isspace (*q) && *q != ':'; q++)
     continue;
   srvr_len = q - p;
   server = (char *) xmalloc (srvr_len + 1);
@@ -1745,14 +1745,14 @@
     {
       static char const ripe1[] = "European Regional Internet Registry/RIPE";
       static char const ripe2[] = "RIPE NCC (NET-RIPE-NCC-";
-      static char const apnic[] = "Asia Pacific Network Information Center";
+      static char const apnic[] = "Asia Pacific Network Information Centre";
       static char const nomatch[] = "No match";
       static char const updated[] = "Record last updated on ";
       static char const hostname[] = "Hostname:";
       auto char arin_query[200];

 try_next_addr:
-      strcpy (arin_query, "net ");
+      strcpy (arin_query, "n ");
       strcat (arin_query, dotted_blockname);
       whois_data = whois (arin_server, arin_query);
       if (whois_data == NULL)  /* Server must be down!  */
@@ -1760,8 +1760,15 @@
       if (strncmp (whois_data, nomatch, sizeof nomatch -1))
 	{
 	  register char const *rwhois_data;
+	  char const *orgname = strstr (whois_data, "OrgName:");

-          if (!strncmp (whois_data, ripe1, sizeof ripe1 - 1))
+	  if (orgname)
+	    {
+	      orgname += sizeof "OrgName:";
+	      while (isspace (*orgname))
+		orgname++;
+	    }
+          if (orgname && !strncmp (orgname, ripe1, sizeof ripe1 - 1))
 	    {
               if (try_ripe (dotted_quad))
                 break;
@@ -1769,7 +1776,7 @@
                 return 0;
 	    }

-          if (!strncmp (whois_data, ripe2, sizeof ripe2 - 1))
+          if (orgname && !strncmp (orgname, ripe2, sizeof ripe2 - 1))
 	    {
               if (try_ripe (dotted_quad))
                 break;
@@ -1777,7 +1784,7 @@
                 return 0;
 	    }

-          if (!strncmp (whois_data, apnic, sizeof apnic - 1))
+          if (orgname && !strncmp (orgname, apnic, sizeof apnic - 1))
 	    {
               if (try_apnic (dotted_quad))
                 break;
@@ -1802,6 +1809,7 @@
 	      goto try_next_addr;
 	    }

+#if 0	/* needs fixing */
           if (!substr (whois_data, updated))
             {
               /* Handle a special case.  ARIN has returned to us a list of
@@ -1813,6 +1821,7 @@
               if ((whois_data = arin_grunge (whois_data, addr)) == NULL)
 		return 1;
             }
+#endif
 	  if ((rwhois_data = fetch_rwhois_data (whois_data, dotted_quad)))
 	    return present_rwhois_style_results (rwhois_data, whois_data);
 	  else
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: agc 
State-Changed-When: Mon Dec 15 17:02:36 UTC 2003 
State-Changed-Why:  
agc applied the patch in the PR - thanks for that, it's nice to have a working 
ipw again. 


Responsible-Changed-From-To: pkg-manager->agc 
Responsible-Changed-By: agc 
Responsible-Changed-When: Mon Dec 15 17:02:36 UTC 2003 
Responsible-Changed-Why:  
agc took responsibility for this one 

From: "Alistair G. Crooks" <agc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/22475 CVS commit: pkgsrc/net/ipw
Date: Mon, 15 Dec 2003 17:02:22 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	agc
 Date:		Mon Dec 15 17:02:22 UTC 2003

 Modified Files:
 	pkgsrc/net/ipw: Makefile distinfo
 Added Files:
 	pkgsrc/net/ipw/patches: patch-ab

 Log Message:
 Apply patch from Geoff C. Wing from PR 22475 to make ipw work properly again
 after changes to the ARIN whois response.

 Bump PKGREVISION


 To generate a diff of this commit:
 cvs rdiff -r1.4 -r1.5 pkgsrc/net/ipw/Makefile
 cvs rdiff -r1.3 -r1.4 pkgsrc/net/ipw/distinfo
 cvs rdiff -r0 -r1.1 pkgsrc/net/ipw/patches/patch-ab

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.