- 27 Mar, 2016 21 commits
-
-
Stephen Hemminger authored
Run script that removes trailing whitespace everywhere.
-
Marco Varlese authored
An attempt to add invalid address to interface would print "???" string instead of the address family name. For example: $ ip address add 256.10.166.1/24 dev ens8 Error: ??? prefix is expected rather than "256.10.166.1/24". $ ip neighbor add proxy 2001:db8::g dev ens8 Error: ??? address is expected rather than "2001:db8::g". With this patch the output will look like: $ ip address add 256.10.166.1/24 dev ens8 Error: inet prefix is expected rather than "256.10.166.1/24". $ ip neighbor add proxy 2001:db8::g dev ens8 Error: inet6 address is expected rather than "2001:db8::g". Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com> Signed-off-by: Marco Varlese <marco.varlese@intel.com>
-
Phil Sutter authored
Apart from making the code a bit more compact and efficient, this also prevents a potential buffer overflow if the passed buffer is really too small: Although correctly decrementing the size parameter passed to snprintf, it could become negative which would then wrap since snprintf uses (unsigned) size_t for the parameter. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
This simple macro eases calling rt_addr_n2a() with data from an rt_attr pointer. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
This simple macro eases calling format_host() with data from an rt_attr pointer. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
There is only a single user who needs it to be reentrant (not really, but it's safer like this), add rt_addr_n2a_r() for it to use. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
There are only three users which require it to be reentrant, the rest is fine without. Instead, provide a reentrant format_host_r() for users which need it. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
This adds two helper functions which map a given data field to a color, so color_fprintf() statements don't have to be duplicated with only a different color value depending on that data field's value. In order for this to work in a generic way, COLOR_CLEAR has been added to serve as a fallback default of uncolored output. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
This should be made generic and part of a common tc-actions man page. Though leave it here for now to not confuse readers of the example which uses it. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
As Jamal pointed out, there are two different approaches to bandwidth measurement. Try to make this clear by separating them in synopsis and also documenting the way to fine-tune avrate. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
As Jamal suggested, BRANCH is the wrong name, as these keywords go beyond simple branch control - e.g. loops are possible, too. Therefore rename the non-terminal to CONTROL instead which should be more appropriate. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com> Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
This is not a full test, since kernel functionality is not actually tested. It only compares that the kernel returned values when listing the action are what one expects them to be. Since this test succeeded on both a little-endian and a big-endian system, it shows that any endianness issues have been resolved in tc/p_ip.c at least. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
The retain value was wrong for u16 and u8 types. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
This was tricky to get right: - The 'stride' value used for 8 and 16 bit values must behave inverse to the value's intra word offset to work correctly with big-endian data act_pedit is editing. - The 'm' array's values are in host byte order, so they have to be converted as well (and the ordering was just inverse, for some reason). - The only sane way of getting this right is to manipulate value/mask in host byte order and convert the output. - TIPV4 (i.e. 'munge ip src/dst') had it's own pitfall: the address parser converts to network byte order automatically. This patch fixes this by converting it back before calling pack_key32, which is a hack but at least does not require to implement a completely separate code flow. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
Phil Sutter authored
Break overlong function definitions and remove one extraneous whitespace. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-
- 21 Mar, 2016 11 commits
-
-
Zhang Shengju authored
Add support for ignore route attribute, and refine the code to use rta_getattr_* function to get attribute value. Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
-
Zhang Shengju authored
Update this manual to add attributes proxy_neigh and ignore_routes_with_linkdown. Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
-
Stephen Hemminger authored
The number of casts in macro was excessive.
-
Stephen Hemminger authored
-
Stephen Hemminger authored
More checkpatch spring cleaning
-
Stephen Hemminger authored
Use checkpatch auto fix to cleanup lingering style issues
-
Stephen Hemminger authored
Run all the ip code through checkpatch and have it fix the obvious stuff.
-
Stephen Hemminger authored
Use checkpatch to fix whitespace and other style issues.
-
Luca Lemmo authored
Signed-off-by: Luca Lemmo <luca@linux.com>
-
Luca Lemmo authored
Signed-off-by: Luca Lemmo <luca@linux.com>
-
Luca Lemmo authored
Signed-off-by: Luca Lemmo <luca@linux.com>
-
- 14 Mar, 2016 3 commits
-
-
Nikolay Aleksandrov authored
Recently a new temp router port mode was added and with it the dumped information was extended similar to how mdb entries were done. This patch adds support to dump the new information by using the "-s" switch. Example: $ bridge -d -s mdb show dev br0 port eth1 grp ff02::1:ffbf:5716 temp 234.39 dev br0 port eth1 grp 239.0.0.2 temp 97.17 dev br0 port eth1 grp 239.0.0.3 temp 105.36 router ports on br0: eth1 0.00 permanent router ports on br0: eth2 254.87 temp It also updates the bridge man page. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
-
Stephen Hemminger authored
-
Stephen Hemminger authored
-
- 06 Mar, 2016 5 commits
-
-
Stephen Hemminger authored
-
Phil Sutter authored
Since the IP Header Length field is just half a byte, adjust retain to only match these bits so the Version field is not overwritten by accident. The whole concept is actually broken due to dependency on endianness which pedit ignores. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
This was horribly broken: * pack_key8() and pack_key16() ... * missed to invert retain value when applying it to the mask, * did not sanitize val by ANDing it with retain, * and ignored the mask which is necessary for 'invert' command. * pack_key16() did not convert mask to network byte order. * Changing the retain value for 'invert' or 'retain' operation seems just plain wrong. * While here, also got rid of unnecessary offset sanitization in pack_key32(). * Simplify code a bit by always assigning the local mask variable to tkey->mask before calling any of the pack_key*() variants. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
After lookup of the layered op submodule, pedit would pass argv and argc including the layered op identifier at first position which confused the submodule parser. Fix this by calling NEXT_ARG() before calling the parse_peopt() callback. Signed-off-by: Phil Sutter <phil@nwl.cc>
-
Phil Sutter authored
There have been reports about 'ip addr' printing "Message truncated" on systems with large numbers of VFs. Although I haven't been able to get my hands on hardware suitable to reproduce this, increasing the dump buffer has been reported to resolve the issue. For want of a better idea, just double the buffer size to 32k. Feels like this opportunistic buffer size selection is rather workarounding a design flaw in libnetlink or maybe even the netlink protocol itself. Signed-off-by: Phil Sutter <phil@nwl.cc>
-