From: Andreas Henriksson Date: Fri, 29 Aug 2008 17:26:42 +0000 (+0200) Subject: ip: abbreviation of network-prefix is no longer possible with ip route X-Git-Tag: v2.6.27~15^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ca4abdcb823e708b88156f947fa5b493055618a;p=thirdparty%2Fiproute2.git ip: abbreviation of network-prefix is no longer possible with ip route Commit 516ffb6b7724e97ca035293dcfd9f94cf6ce3a47 says: Stephen Hemminger [Thu, 22 May 2008 20:41:40 +0000 (13:41 -0700)] > Use the standard POSIX inet_pton to convert from string to IPV4 > address. This avoids problems where ip parses "127.2" wrong. Apparently inet_pton doesn't support abbreviated/shortened/classful ipv4 addresses at all, but inet_aton does. Since the function only deals with AF_INET anyway maybe using inet_aton "to increse backwards compatability" (please those who still want to use the format) could be considered? (This will still not restore the 10/8 format which apparently used to work in iproute, so people would have to settle for 10.0/8) (See http://bugs.debian.org/497011) --- diff --git a/lib/utils.c b/lib/utils.c index a88f82b5d..21cf0ea09 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -284,7 +284,7 @@ int get_addr_1(inet_prefix *addr, const char *name, int family) addr->family = AF_INET; if (family != AF_UNSPEC && family != AF_INET) return -1; - if (inet_pton(AF_INET, name, addr->data) <= 0) + if (inet_aton(name, addr->data) <= 0) return -1; addr->bytelen = 4; addr->bitlen = -1;