- 05 Feb, 2015 10 commits
-
-
Vadim Kochan authored
This change allows to exec some cmd on each named netns (except default) by specifying '-all' option: # ip -all netns exec ip link Each command executes synchronously. Exit status is not considered, so there might be a case that some CMD can fail on some netns but success on the other. EXAMPLES: 1) Show link info on all netns: $ ip -all netns exec ip link netns: test_net 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500 link/ether 1a:19:6f:25:eb:85 brd ff:ff:ff:ff:ff:ff netns: home0 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500 link/ether ea:1a:59:40:d3:29 brd ff:ff:ff:ff:ff:ff netns: lan0 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 4: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 500 link/ether ce:49:d5:46:81:ea brd ff:ff:ff:ff:ff:ff 2) Set UP tap0 device for the all netns: $ ip -all netns exec ip link set dev tap0 up netns: test_net netns: home0 netns: lan0 Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Added possibility to run some func on each netns. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Stephen Hemminger authored
Sanitized header from upstream 3.20-rc kernel
-
Vadim Kochan authored
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Added two tests which checks the following fixed issues: 1) Bug when not possible add new virtual interface via: $ ip link add dev XXX type It was fixed a few releases ago. 2) Crash on older kernels when VF rate info does not exist: $ ip link show Used dump file from William Dauchy <william@gandi.net>: testsuite/tests/ip/link/dev_wo_vf_rate.nl So 'ip link show' replaced by 'ip -d monitor file ...' which does the same thing. Also added new func in testsuite/lib/generic.sh to gen new random dev name. Added 'clean' dependency on running all tests. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
As inet dgram sockets (udp, raw) can call connect(...) - they might be set in ESTABLISHED state. So keep the original behaviour of 'ss' which filtered them by ESTABLISHED state by default. So: $ ss -u or $ ss -w Will show only ESTABLISHED UDP sockets by default. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Nicolas Dichtel authored
When HAVE_SETNS is not set, iproute2 provides a local implementation of this function based on __NR_setns. This macro is defined in sys/syscall.h, which was not included, thus the local implementation always returned -1. CC: Vadim Kochan <vadim4j@gmail.com> Fixes: eb67e449 ("lib: Add netns_switch func for change network namespace") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
-
Nicolas Dichtel authored
Warning was: In file included from bridge.c:16:0: ../include/namespace.h:33:12: warning: ‘setns’ defined but not used [-Wunused-function] CC: Vadim Kochan <vadim4j@gmail.com> Fixes: eb67e449 ("lib: Add netns_switch func for change network namespace") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
-
Reese Moore authored
In the ip-link(8) man page, for the gretap, ip6gre, and ip6gretap types, the word tunnel was incorrectly spelled 'tuunel'. Signed-off-by: Reese Moore <ram@vt.edu>
-
- 14 Jan, 2015 9 commits
-
-
Stephen Hemminger authored
Need to check for invalid address and buffer overrun in ip neigh command with invalid paramters.
-
Vadim Kochan authored
Renamed get_netns_fd -> netns_get_fd and moved to lib/namespace.c Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Add #define for nlmsg_type = 15 Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
When 'ss' prints UDP sockets info together with RAW sockets e.g.: $ ss -a then UDP sockets are resolved as "ipproto-xxx". It was caused that dg_proto was set after printing UDP socket info from netlink. So fixed issue by moving setting dg_proto before printing info from Netlink. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
The issue was caused that ifla_vf_rate does not exist on older kernels and should be checked if it exists as nested attr. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Reported-by: William Dauchy <william@gandi.net> Tested-by: William Dauchy <william@gandi.net>
-
Jamal Hadi Salim authored
When specified in a graph such as: action vlan ... action foobar the vlan action chewed more than it can swallow Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
-
Jiri Pirko authored
addrgenmode is currently write only by ip. So display this information if provided by kernel as well. Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-
- 07 Jan, 2015 4 commits
-
-
Vadim Kochan authored
This patch fixes some filtering combinations issues which does not work on the 'master' version: $ ss -4 shows inet & unix sockets, instead of only inet sockets $ ss -u needs to specify 'state closed' $ ss src unix:*X11* needs to specify '-x' shortcut for UNIX family $ ss -A all shows only sockets with established states There might some other issues which was not observed. Also changed logic for calculating families, socket types and states filtering. I think that this version is a little simpler one. Now there are 2 predefined default tables which describes the following maping: family -> (states, dbs) db -> (states, families) Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Refactored to use one func for output packet stats info from both /proc and netlink. Added possibility to get packet stats info from /proc by setting environment variable PROC_ROOT or PROC_NET_PACKET. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Refactored to use one func for output unix stats info from both /proc and netlink. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Jiri Pirko authored
Sometimes, it is more convenient to get only one specific nested attribute by type. For example for IFLA_AF_SPEC where type is address family (AF_INET6). So add this helper for this purpose. Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-
- 03 Jan, 2015 1 commit
-
-
Stephen Hemminger authored
Suggested by Vadim Kochan
-
- 01 Jan, 2015 4 commits
-
-
Scott Feldman authored
v2: Resending now that the dust has cleared in 3.18 on "self" vs. hwmode debate for brport settings. learning_sync is now set/cleared using "self" qualifier on brport. v1: Add 'learned_sync' flag to turn on/off syncing of learned MAC addresses from offload device to bridge's FDB. Flag is be set/cleared on offload device port using "self" qualifier: $ sudo bridge link set dev swp1 learning_sync on self $ bridge -d link show dev swp1 2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 2 hairpin off guard off root_block off fastleave off learning off flood off 2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 learning on learning_sync on Adds new IFLA_BRPORT_LEARNED_SYNCED attribute for IFLA_PROTINFO on the SELF brport. Signed-off-by: Scott Feldman <sfeldma@gmail.com>
-
Vadim Kochan authored
Stolen from generated doc/ss.html Also added reference to RFC 793 for TCP states. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Fixed -t[short] to -ts[hort] as '-t' is related to -timestamp option. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
- 27 Dec, 2014 8 commits
-
-
Vadim Kochan authored
Added new '-netns' option to simplify executing following cmd: ip netns exec NETNS tc OPTIONS COMMAND OBJECT to tc -n[etns] NETNS OPTIONS COMMAND OBJECT e.g.: tc -net vnet0 qdisc Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-
Vadim Kochan authored
Added new '-netns' option to simplify executing following cmd: ip netns exec NETNS bridge OPTIONS COMMAND OBJECT to bridge -n[etns] NETNS OPTIONS COMMAND OBJECT e.g.: bridge -net vnet0 fdb Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-
Vadim Kochan authored
Added new '-netns' option to simplify executing following cmd: ip netns exec NETNS ip OPTIONS COMMAND OBJECT to ip -n[etns] NETNS OPTIONS COMMAND OBJECT e.g.: ip -net vnet0 link add br0 type bridge ip -n vnet0 link Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-
Vadim Kochan authored
New netns_switch func moved to the lib/namespace.c from ip/ipnetns.c so it can be used from the other tools for fast switching network namespace. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
-
Vadim Kochan authored
Just another refactoring for ss to use rtnl API from lib Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Added new '-g[raph]' option which shows classes in the graph view. Meanwhile only generic stats info output is supported. e.g.: $ tc/tc -g class show dev tap0 +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b | +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b | +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b | | +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b | | | +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b | +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b $ tc/tc -g -s class show dev tap0 +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | | rate 0bit 0pps backlog 0b 0p requeues 0 | | | +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | | rate 0bit 0pps backlog 0b 0p requeues 0 | | | +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b | | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | | | rate 0bit 0pps backlog 0b 0p requeues 0 | | | | | +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b | | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | | rate 0bit 0pps backlog 0b 0p requeues 0 | | | +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | rate 0bit 0pps backlog 0b 0p requeues 0 | +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | rate 0bit 0pps backlog 0b 0p requeues 0 | +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | rate 0bit 0pps backlog 0b 0p requeues 0 | +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b | Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) | rate 0bit 0pps backlog 0b 0p requeues 0 | +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Heiner Kallweit authored
Extend "ip-address" man page to reflect the recent extension of allowing to list addresses with flags tentative, deprecated, dadfailed not being set. Signed-off-by: Heiner Kallweit <heiner.kallweit@web.de>
-
- 24 Dec, 2014 4 commits
-
-
Roopa Prabhu authored
Currently self is set internally only if hwmode is set. This makes it necessary for the hw to have a mode. There is no hwmode really required to go to hardware. So, introduce self for anybody who wants to target hardware. v1 -> v2 - fix a few bugs. Initialize flags to zero: this was required to keep the current behaviour unchanged. v2 -> v3 - fix comment Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Reviewed-by: Jiri Pirko <jiri@resnulli.us>
-
Duan Jiong authored
Use addattr_nest() and addattr_nest_end() to simplify the code. Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
-
Stephen Hemminger authored
-
Stephen Hemminger authored
-