From owner-freebsd-bugs@FreeBSD.ORG Wed Apr 27 23:10:01 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7564416A4CE for ; Wed, 27 Apr 2005 23:10:01 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1462543D46 for ; Wed, 27 Apr 2005 23:10:01 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3RNA0a0072397 for ; Wed, 27 Apr 2005 23:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3RNA0RJ072396; Wed, 27 Apr 2005 23:10:00 GMT (envelope-from gnats) Resent-Date: Wed, 27 Apr 2005 23:10:00 GMT Resent-Message-Id: <200504272310.j3RNA0RJ072396@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Adrian Frith Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1A1E16A4CE for ; Wed, 27 Apr 2005 23:05:10 +0000 (GMT) Received: from ctb-mesg1.saix.net (ctb-mesg1.saix.net [196.25.240.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 938F843D1F for ; Wed, 27 Apr 2005 23:05:09 +0000 (GMT) (envelope-from adrian@frith.homelinux.org) Received: from frith.homelinux.org (wbs-146-138-26.telkomadsl.co.za [165.146.138.26]) by ctb-mesg1.saix.net (Postfix) with ESMTP id 3705B531A for ; Thu, 28 Apr 2005 01:05:06 +0200 (SAST) Received: from frith.homelinux.org (localhost [127.0.0.1]) by frith.homelinux.org (8.13.3/8.13.3) with ESMTP id j3RN56Ya081998 for ; Thu, 28 Apr 2005 01:05:06 +0200 (SAST) (envelope-from adrian@frith.homelinux.org) Received: (from adrian@localhost) by frith.homelinux.org (8.13.3/8.13.3/Submit) id j3RN56pJ081997; Thu, 28 Apr 2005 01:05:06 +0200 (SAST) (envelope-from adrian) Message-Id: <200504272305.j3RN56pJ081997@frith.homelinux.org> Date: Thu, 28 Apr 2005 01:05:06 +0200 (SAST) From: Adrian Frith To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/80421: [PATCH] whois(1) should query AfriNIC server for African IP's X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Adrian Frith List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 23:10:01 -0000 >Number: 80421 >Category: bin >Synopsis: [PATCH] whois(1) should query AfriNIC server for African IP's >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 27 23:10:00 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Adrian Frith >Release: FreeBSD 5.4-STABLE i386 >Organization: University of Cape Town, South Africa >Environment: System: FreeBSD frith.homelinux.org 5.4-STABLE FreeBSD 5.4-STABLE #0: Mon Apr 25 02:25:26 SAST 2005 root@diogenes.frith:/usr/obj/usr/src/sys/DIOGENES i386 >Description: As of 2005-02-21, management of IP numbers used on the continent of Africa and the western Indian Ocean islands has been transferred from ARIN and RIPE NCC to the new AfriNIC RIR (www.afrinic.net). Since this change, the ARIN whois server does not return useful information for queries on IP numbers in the ranges which have been transferred. Therefore, the /usr/bin/whois utility should use the AfriNIC whois server (whois.afrinic.net) when appropriate (as it does for APNIC, LACNIC and RIPE NCC IP ranges). >How-To-Repeat: Use the /usr/bin/whois utility to query any IP number in the ranges which are now managed by AfriNIC. These include 196.2[3-6].0.0/16, 165.14[3-9].0.0/16, and 137.158.0.0/16. For example, 'whois 137.158.128.3' returns only the information that the range has been transferred to AfriNIC, while 'whois -h whois.afrinic.net 137.158.128.3' returns useful information about the IP's ownership. >Fix: Apply the attached patch to the whois sources. --- whois-afrinic.patch begins here --- --- usr.bin/whois/whois.c.orig Wed Apr 27 23:09:06 2005 +++ usr.bin/whois/whois.c Thu Apr 28 00:01:37 2005 @@ -77,6 +77,7 @@ #define NORIDHOST "whois.norid.no" #define IANAHOST "whois.iana.org" #define GERMNICHOST "de.whois-servers.net" +#define FNICHOST "whois.afrinic.net" #define DEFAULT_PORT "whois" #define WHOIS_SERVER_ID "Whois Server: " #define WHOIS_ORG_SERVER_ID "Registrant Street1:Whois Server:" @@ -86,7 +87,8 @@ #define ishost(h) (isalnum((unsigned char)h) || h == '.' || h == '-') -const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST, NULL }; +const char *ip_whois[] = { LNICHOST, RNICHOST, PNICHOST, BNICHOST, + FNICHOST, NULL }; const char *port = DEFAULT_PORT; static char *choose_server(char *); @@ -108,7 +110,7 @@ country = host = qnichost = NULL; flags = use_qnichost = 0; - while ((ch = getopt(argc, argv, "aAbc:dgh:iIklmp:QrR6")) != -1) { + while ((ch = getopt(argc, argv, "aAbc:dfgh:iIklmp:QrR6")) != -1) { switch (ch) { case 'a': host = ANICHOST; @@ -125,6 +127,9 @@ case 'd': host = DNICHOST; break; + case 'f': + host = FNICHOST; + break; case 'g': host = GNICHOST; break; @@ -355,7 +360,7 @@ usage(void) { fprintf(stderr, - "usage: whois [-aAbdgiIklmQrR6] [-c country-code | -h hostname] " + "usage: whois [-aAbdfgiIklmQrR6] [-c country-code | -h hostname] " "[-p port] name ...\n"); exit(EX_USAGE); } --- usr.bin/whois/whois.1.orig Wed Apr 27 23:39:02 2005 +++ usr.bin/whois/whois.1 Wed Apr 27 23:58:04 2005 @@ -40,7 +40,7 @@ .Nd "Internet domain name and network number directory service" .Sh SYNOPSIS .Nm -.Op Fl aAbdgiIklmQrR6 +.Op Fl aAbdfgiIklmQrR6 .Op Fl c Ar country-code | Fl h Ar host .Op Fl p Ar port .Ar name ... @@ -58,7 +58,7 @@ .Pq Tn ARIN database. It contains network numbers used in those parts of the world covered neither by -.Tn APNIC +.Tn APNIC , AfriNIC , LACNIC , nor by .Tn RIPE . .Pp @@ -87,6 +87,11 @@ database. It contains points of contact for subdomains of .Pa .MIL . +.It Fl f +Use the African Network Information Centre +.Pq Tn AfriNIC +database. It contains network numbers used in Africa and the islands of the +western Indian Ocean. .It Fl g Use the US non-military federal government database, which contains points of contact for subdomains of @@ -112,7 +117,7 @@ If a query to .Tn ARIN references -.Tn APNIC , LACNIC , +.Tn APNIC , AfriNIC , LACNIC , or .Tn RIPE , that server will be queried also, provided that the --- whois-afrinic.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: