[PATCH] Do not use -V on RIPE/Bird WHOIS queries

Faidon Liambotis paravoid at debian.org
Fri Jan 7 17:04:44 UTC 2011


irtoolset currently sends -V <ProjectVersion> for all of its WHOIS
queries.

RIPE's Database Query Reference Manual, section "Access Control for
Queries" mentions that this is used by proxies to indicate the client's
IP address in the syntax
    -V <version>,<ipv4-address>
which is obviously not something that irrtoolset does or needs.

The help output in RIPE's own WHOIS server, however, mentions:
    -V<client-tag>   Sends information about the client to the server.
which is probably the reason for this misconception.

(in HTTP terms, that would be a Via vs. User-Agent header)

The WHOIS server's source indicates that the former is the proper
meaning of the flag and even irrtoolset clients that try to pass that
without being explicitelly marked as trusted proxies.

Hence, stop sending the flag altogether.
---
 src/irr/birdwhoisc.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/irr/birdwhoisc.cc b/src/irr/birdwhoisc.cc
index 5fa9748..58bf6f9 100644
--- a/src/irr/birdwhoisc.cc
+++ b/src/irr/birdwhoisc.cc
@@ -73,9 +73,9 @@ bool BirdWhoisClient::sendQuery(const char *pzcQuery, ...)
   char pzcBuffer[BUFFER_SIZE + 1];
   char pzcFormat[512];
   if (sources && *sources) 
-     sprintf(pzcFormat, "-k -V %s -r -s %s %s\r\n", ProjectVersion, sources, pzcQuery);
+     sprintf(pzcFormat, "-k -r -s %s %s\r\n", sources, pzcQuery);
   else
-     sprintf(pzcFormat, "-k -V %s -r %s\r\n", ProjectVersion, pzcQuery);
+     sprintf(pzcFormat, "-k -r %s\r\n", pzcQuery);
 
   va_list ap;
   va_start(ap, pzcQuery);
-- 
1.7.2.3




More information about the irrtoolset mailing list