From cvs-return-5928-apmail-apr-cvs-archive=apr.apache.org@apr.apache.org Fri Jun 25 13:52:05 2004 Return-Path: Delivered-To: apmail-apr-cvs-archive@www.apache.org Received: (qmail 56538 invoked from network); 25 Jun 2004 13:52:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jun 2004 13:52:05 -0000 Received: (qmail 12108 invoked by uid 500); 25 Jun 2004 13:51:57 -0000 Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 11875 invoked by uid 500); 25 Jun 2004 13:51:54 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 11716 invoked by uid 99); 25 Jun 2004 13:51:52 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Date: 25 Jun 2004 13:51:46 -0000 Message-ID: <20040625135146.56309.qmail@minotaur.apache.org> From: martin@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/network_io/unix sockaddr.c X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N martin 2004/06/25 06:51:46 Modified: network_io/unix sockaddr.c Log: Reminder for bugginess Revision Changes Path 1.53 +13 -0 apr/network_io/unix/sockaddr.c Index: sockaddr.c =================================================================== RCS file: /home/cvs/apr/network_io/unix/sockaddr.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -u -r1.52 -r1.53 --- sockaddr.c 1 Jun 2004 19:50:14 -0000 1.52 +++ sockaddr.c 25 Jun 2004 13:51:46 -0000 1.53 @@ -767,6 +767,19 @@ if (shift < 0) { return APR_EBADIP; } +/*@@@ WARNING: BEWARE: +The man page for inet_pton()/inet_aton() et.al. says: + All numbers supplied as ``parts'' in a `.' notation may be decimal, + octal, or hexadecimal, as specified in the C language (i.e., a leading 0x + or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- + wise, the number is interpreted as decimal). +OTOH, "man atoi" says: + The atoi() function [...] is equivalent to: + (int)strtol(nptr, (char **)NULL, 10); +which forces interpretation as _decimal_. As a result, this routine will +interpret a string 0177.0000.0000.0001 as 177.0.0.1, while inet_pton() +will interpret it as 127.0.0.1! +@@@*/ octet = atoi(s); if (octet < 0 || octet > 255) { return APR_EBADIP;