Commit Graph

359 Commits

Author SHA1 Message Date
Stephen Hemminger
1f01dd89f5 update headers to 3.20-rc1
Add net_namespace.h and update other headers
2015-02-20 16:58:45 -08:00
Stephen Hemminger
3a641f531e Merge branch 'net-next' 2015-02-10 15:20:57 -08:00
Stephen Hemminger
46d364fe8f v3.19.0 2015-02-10 15:14:32 -08:00
Jiri Pirko
86ab59a666 tc: add support for BPF based actions
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2015-02-05 10:38:13 -08:00
Stephen Hemminger
c5ecc59f10 Merge branch 'master' into net-next 2015-02-05 10:33:13 -08:00
Vadim Kochan
b13ba03f54 ip netns: Allow exec on each netns
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>
2015-02-05 10:28:19 -08:00
Vadim Kochan
e998e118dd lib: Exec func on each netns
Added possibility to run some func on each netns.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2015-02-05 10:28:19 -08:00
Stephen Hemminger
8c58d4036b update kernel headers based on net-next 3.21
Pull in headers from later tree
2015-02-05 10:20:58 -08:00
Stephen Hemminger
668dfab274 Merge branch 'master' into net-next 2015-02-05 10:20:10 -08:00
Stephen Hemminger
4c7d75de95 can: update kernel header
Sanitized header from upstream 3.20-rc kernel
2015-02-05 10:17:50 -08:00
Nicolas Dichtel
1ff6b16e2d lib: fix setns() function when !HAVE_SETNS
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: eb67e4498a ("lib: Add netns_switch func for change network namespace")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
2015-02-05 10:11:51 -08:00
Nicolas Dichtel
ffff693130 lib: fix warning in namespace.h
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: eb67e4498a ("lib: Add netns_switch func for change network namespace")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
2015-02-05 10:11:35 -08:00
Stephen Hemminger
242a9f73b6 Merge branch 'master' into net-next 2015-01-13 17:43:45 -08:00
Stephen Hemminger
f233410d20 update kernel headers to 3.19 net-next 2015-01-13 17:39:32 -08:00
Vadim Kochan
c3087c10f1 netns: Rename & move get_netns_fd to lib
Renamed get_netns_fd -> netns_get_fd and moved to
lib/namespace.c

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2015-01-13 17:34:47 -08:00
Vadim Kochan
ddb1129b75 Use one func to print timestamp from nlmsg
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2015-01-13 17:34:47 -08:00
Vadim Kochan
27b14f2e87 Add define for nlmsg_types with timestamp
Add #define for nlmsg_type = 15

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2015-01-13 17:34:47 -08:00
Jiri Pirko
decbb4378c libnetlink: add parse_rtattr_one_nested helper
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>
2015-01-07 15:11:35 -08:00
Vadim Kochan
eb67e4498a lib: Add netns_switch func for change network namespace
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>
2014-12-27 10:22:27 -08:00
Vadim Kochan
486ccd99a0 ss: Use rtnl_dump_filter for inet_show_netlink
Just another refactoring for ss to use rtnl API from lib

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2014-12-27 10:21:10 -08:00
Stephen Hemminger
5c2c10b17e Merge branch 'net-next' 2014-12-24 12:23:00 -08:00
Stephen Hemminger
bfbccea783 v3.18.0 2014-12-24 12:20:49 -08:00
Vadim Kochan
79aa79d058 ip lib: Added shorter timestamp option
Added another timestamp format to look like more logging info:

[2014-12-22T22:36:50.489 ] 2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default
    link/ether 3c:97:0e:a3:86:2e brd ff:ff:ff:ff:ff:ff

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2014-12-24 12:07:36 -08:00
Stephen Hemminger
093f18fd7a update kernel headers to 3.19-rc1 2014-12-20 12:22:01 -08:00
Stephen Hemminger
effdfc9e87 Merge branch 'master' into net-next 2014-12-20 12:18:14 -08:00
vadimk
8a4025f6a4 ss: Use rtnl_dump_filter in handle_netlink_request
Replaced handling netlink messages by rtnl_dump_filter
from lib/libnetlink.c, also:

    - removed unused dump_fp arg;
    - added MAGIC_SEQ #define for 123456 seq id;
    - silently exit if ENOENT errno is caused for NETLINK_SOCK_DIAG proto
        in lib/libnetlink.c: rtnl_duml_filter_l(...) function. This fix
        was added in a3fd8e58c1 by Eric
        for misc/ss.c

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2014-12-20 12:17:02 -08:00
Stephen Hemminger
8a504fc356 resolve header file conflict betwen linux/in6.h and netinet/in.h
Go back to kernel version of if_bridge.h and use patched
version of linux/in6.h and libc-compat.h
2014-12-20 12:14:30 -08:00
Stephen Hemminger
9d2c16438c if_bridge: remove in6.h
Adding in6.h breaks build with redefined values.
2014-12-09 20:19:26 -08:00
Stephen Hemminger
c9b8aef6ae Merge branch 'master' into net-next 2014-12-09 16:33:59 -08:00
Stephen Hemminger
5a311b0bec need libc-compat.h for new in6.h
The header wars continue...
2014-12-05 12:47:34 -08:00
Stephen Hemminger
69fdff1fdb add local version of linux/in6.h
Need this header file to avoid build issues on older systems
like Debian 7
2014-12-05 12:16:36 -08:00
Jiri Pirko
8b1c0216d8 tc: add support for vlan tc action
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Reviewed-by: Cong Wang <cwang@twopensource.com>
2014-12-03 09:29:21 -08:00
Stephen Hemminger
1c0986873e update kernel headers to net-next (3.18-rc6)
Early merge of upstream headers
2014-12-03 09:27:43 -08:00
Stephen Hemminger
e9c4b7c38f update if_bridge
Use current upstream header.
2014-11-30 09:48:14 -08:00
Dave Taht
1fa804e0d3 iproute2: Add support for babel protocol table entry 2014-11-29 11:24:25 -08:00
vadimk
eef43b5052 ss: Identify more netlink protocol names
There were only few Netlink protocol names
which were printed on the screen:

    rtnl, fw, tcpdiag

So added the ability to identify Netlink proto name
from /etc/iproute/nl_protos or from static table.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
2014-11-29 11:13:38 -08:00
Tom Herbert
6928747b6e ip fou: Support to configure foo-over-udp RX
Added 'ip fou...' commands to enable/disable UDP ports for doing
foo-over-udp and Generic UDP Encapsulation variant. Arguments are port
number to bind to and IP protocol to map to port (for direct FOU).

Examples:

ip fou add port 7777 gue
ip fou add port 8888 ipproto 4

The first command creates a GUE port, the second creates a direct FOU
port for IPIP (receive payload is a assumed to be an IPv4 packet).

Signed-off-by: Tom Herbert <therbert@google.com>
2014-11-06 16:17:34 -08:00
Stephen Hemminger
1e264abc3a ip: add iec formatted option and cleanup code
Add a new -iec option in addition to -human.
Cleanup code so the formatting of numbers is done in one function,
not 2 ways and 2 sizes.
2014-11-02 12:49:19 -08:00
Christian Hesse
b68d983754 ip-link: add switch to show human readable output
Byte and packet count can increase to really big numbers. This adds a
switch to show human readable output.

4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00🇩🇪ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1523846973 3969051  0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8710088361 6077735  0       0       0       0
4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00🇩🇪ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1.5G       3.9M     0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8.7G       6.0M     0       0       0       0
2014-11-02 11:53:29 -08:00
Stephen Hemminger
dddfc7f67e Update kernel headers to 3.18-rc2 2014-10-29 22:32:02 -07:00
Stephen Hemminger
50231ad2a5 v3.17.0 2014-10-09 08:40:14 -07:00
Stephen Hemminger
cd63507430 Merge branch 'net-next' 2014-08-04 12:58:36 -07:00
Stephen Hemminger
a9ae422486 v3.16.0 2014-08-04 12:43:46 -07:00
Stephen Hemminger
945eaebdf7 Update kernel headers to net-next 2014-08-04 12:39:49 -07:00
Stephen Hemminger
656111b2f9 cleanup warnings
ll_index can return -1 but was declared unsigned.
rt_addr_n2a had unused length parameter
2014-08-04 10:30:35 -07:00
Stephen Hemminger
76723fd1c6 Update kernel headers to 3.16-rc5 2014-07-14 11:56:33 -07:00
Stephen Hemminger
0f6d24032f Merge branch 'net-next' 2014-06-10 10:38:00 -07:00
Stephen Hemminger
ce7aff3b8d v3.15.0 2014-06-10 09:39:14 -07:00
Stephen Hemminger
fd5c1d4391 Update to current net-next kernel headers
Update sanitized headers
2014-06-09 12:50:30 -07:00
Stephen Hemminger
ce3436ca05 Update to 3.15-rc2 headers 2014-04-21 08:26:44 -07:00