History log of /external/iproute2/lib/utils.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6644900d2116a2a397bf0ed26ffd845ca2136b52 07-Apr-2010 San Mehat <san@google.com> iproute2: Build tc and netlink/util libs

For http://b/issue?id=2576057

Change-Id: Ic0a5edbdf6496a1a267634147c3c3eea3b3604ac
Signed-off-by: San Mehat <san@google.com>
30d10db5667d3ca86917ca86c1a65cfcc45965f9 20-Dec-2011 Hagen Paul Pfeifer <hagen@jauu.net> utils: add s32 parser

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
21a85d3becf45e02985c466764ae19433d907c40 11-Jul-2011 Stephen Hemminger <shemminger@vyatta.com> Fix test for EOF on continuation line

getline() returns -1 on EOF, need to not loose that by forcing
result to size_t (unsigned).

Reported-by: Petr Sabata
db6b0cfa518de3b27c05bdf3efe05a7f77c4d97d 25-Feb-2011 Gerrit Renker <gerrit@erg.abdn.ac.uk> iproute: rename 'get_jiffies' since it uses msecs

The get_jiffies() function retrieves rtt-type values in units of
milliseconds. This patch updates the function name accordingly,
following the pattern given by dst_metric() <=> dst_metric_rtt().
fca1dae821d627101914c36c9282fc244cd92744 25-Feb-2011 Gerrit Renker <gerrit@erg.abdn.ac.uk> iproute: fix unit conversion of rtt/rttvar/rto_min

Since July 2008 (2.6.27, c1e20f7c8b9), the kernel stores the values for
RTAX_{RTT{,VAR},RTO_MIN} in milliseconds. When using a kernel > 2.6.27 with
the current iproute2, conversion of these values is broken in either way.

This patch
* updates the code to pass and retrieve milliseconds;
* since values < 1msec would be rounded up, also drops the usec/nsec variants;
* since there is no way to query kernel HZ, also drops the jiffies variant.

Arguments such as
rtt 3.23sec
rto_min 0xff
rto_min 0.200s
rttvar 25ms
now all work as expected when reading back previously set values.
897fb84fd9b872a544076f88430bc35fc12b7cc8 21-Dec-2010 Gerrit Renker <gerrit@erg.abdn.ac.uk> utils: get_jiffies always uses base=0

get_jiffies() is in all places called in the same manner, with base=0;
simplify argument list by putting the constant value into the function.
232642c28c5320e6cf1e32f667f866c5f7372bfe 02-Dec-2009 Stephen Hemminger <stephen.hemminger@vyatta.com> Remove Changes: comments

Discourage developers from putting change log in comments
now that software has been under change control for 5 years.
cafa6c8ec1d6e4bddde190edb742be864ce3f9b3 27-Oct-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> Restore old address parsing but with checking

Go back to original address parsing for compatability, but
document it and add more stringent checking.
94afda752956ddc6ff1accf931bc3d03c070bb18 15-Oct-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> Compatiable network abbreviation support

Handle 10/8 as and check for bogus values like 256/8.
This is a comprimise between original iproute2 parsing and standard BSD
parsing of abbreviated IPV4 addresses.
2ca4abdcb823e708b88156f947fa5b493055618a 29-Aug-2008 Andreas Henriksson <andreas@fatal.se> 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)
516ffb6b7724e97ca035293dcfd9f94cf6ce3a47 22-May-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> Use inet_pton to read ipv4 addresses

Use the standard POSIX inet_pton to convert from string to IPV4
address. This avoids problems where ip parses "127.2" wrong.
7dec1bf88bc34e2d0b320f0c23bd1a060c73852b 08-May-2008 Stephen Hemminger <stephen.hemminger@vyatta.com> Fix bad hash calculation because of signed address

The addr[] was being used signed, but this causes hash calcultion
to overflow. Originally reported as Debian bug 480173.
6b1ac654e9364ad279d3c82d8a3ef93efa9f3dfa 31-Dec-2007 Stephen Hemminger <stephen.hemminger@vyatta.com> add decode of match rules

Show ip address etc when decoding output of tc filter show

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
4b270b172a6e570f4e9fa1ebb4bc67b0e715ee48 11-Dec-2007 Stephen Hemminger <shemminger@linux-foundation.org> Fix dotted quad for bit order

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
5a0d1cbf69269bfcb510a8b861b8a83aed0f6b85 08-Dec-2007 Andreas Henriksson <andreas@fatal.se> iproute2: support dotted-quad netmask notation.

On tor, 2007-12-06 at 11:53 -0800, Stephen Hemminger wrote:
> On Tue, 4 Dec 2007 14:58:18 +0100
> Andreas Henriksson <andreas@fatal.se> wrote:
> > Suggested patch for allowing netmask to be specified in dotted quad format.
> > See http://bugs.debian.org/357172
> >
> > (Known problem: this will not prevent some invalid syntaxes,
> > ie. "" will be treated as "")
> >
> > Comments? Suggestions? Improvements?
> Fix the bug you mentioned?
> [... snip example code ...]

Updated patch, added your netmask validation code but without the check
that made (default) and (one address) invalid
netmasks as they are permitted in CIDR format.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
d21e88354b2a42b026384730a767f2108bcf8efe 12-Oct-2007 Andreas Henriksson <andreas@fatal.se> Fix corruption when using batch files with comments and broken lines.
The problem was that length of allocation changed but caller not told.

Anyway, the patch fixes a problem resulting in a double free
that occurs when using batch files that contains a special combination
of broken up lines and comments as reported in:

Thanks to Michal Pokrywka <mpokrywka@hoga.pl> for testcase and information
on which conditions problem could be reproduced under.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
54e0b2e71d723e3b493ff53d1332b48250f5d4bc 11-Oct-2007 Rick Jones <rick.jones2@hp.com> rto support for ip command

Enable users of ip to specify the times for rtt, rttvar and rto_min
in human-friendly terms a la "tc" while maintaining backwards
compatability with the previous "raw" mechanism. Builds upon
David Miller's uncommited patch to set rto_min.

Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
ae665a522bd46bea44c5ea84c89c8b1731954170 05-Dec-2006 Stephen Hemminger <shemminger@osdl.org> Remove trailing whitespace

Go through source files and remove all trailing whitespace

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
9626dfd54c3cc4deec1c651a0bfee65b50feb78b 05-Dec-2006 Stephen Hemminger <shemminger@osdl.org> Add more includes

Add more sanitized headers to make build work,
and get rid of warning

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
351efcde4e62967362a10b29f3b701cfecd7cdfc 01-Sep-2005 shemminger <shemminger> Update header files to 2.6.14
Integrate support for DCCP and tcp_diag into ss
Add -batch to ip command
f332d169246447bd5e258ac03d5ee840a70adb1e 06-Jul-2005 shemminger <shemminger> Cleanup GCC4 warnings about signedness.
90f93024a0818dc691138d8401721e797004b042 07-Jun-2005 shemminger <shemminger> Monitor time patch from Masahide NAKAMURA
f082b64fb40b467bc1f9e5d245114aae4e256d5c 30-Mar-2005 net[shemminger]!shemminger <net[shemminger]!shemminger> Import patch addr-del

(Logical change 1.178)
5e8bc6316b1a6c56598cdb29a737d1d670d74e69 14-Mar-2005 net[shemminger]!shemminger <net[shemminger]!shemminger> Import patch iproute2-hz

(Logical change 1.159)
fb9b1d0f6a9f355bceae435ea43f1c8f3635b2df 07-Feb-2005 osdl.net!shemminger <osdl.net!shemminger> fix potential memory corruption

(Logical change 1.136)
c7699875bee00fbcd057fc62c30d6560b044e007 07-Jul-2004 net[shemminger]!shemminger <net[shemminger]!shemminger> Import patch ipxfrm-20040707_2.diff

(Logical change 1.53)
5dfe556188df2a3b2bfe73c8bc3b3b9216171a93 09-Jun-2004 osdl.org!shemminger <osdl.org!shemminger> Need this when not using kernel headers.

(Logical change 1.16)
4094db72b61dadd16e180eab5f62ccbc82e3976d 02-Jun-2004 osdl.org!shemminger <osdl.org!shemminger> const char *

(Logical change 1.6)
aba5acdfdb347d2c21fc67d613d83d4430ca3937 15-Apr-2004 osdl.org!shemminger <osdl.org!shemminger> (Logical change 1.3)
86fdf0e47be697587efcf9602cd1f952a1d73170 15-Apr-2004 osdl.org!shemminger <osdl.org!shemminger> Initial revision