aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-24Merge changes Id0db30f6,I117dcabd,If21f95e2,I42c1ebfa am: 550751fdb7 am: ↵android-wear-9.0.0_r9android-wear-9.0.0_r8android-wear-9.0.0_r7android-wear-9.0.0_r6android-wear-9.0.0_r5android-wear-9.0.0_r4android-wear-9.0.0_r34android-wear-9.0.0_r33android-wear-9.0.0_r32android-wear-9.0.0_r31android-wear-9.0.0_r30android-wear-9.0.0_r3android-wear-9.0.0_r29android-wear-9.0.0_r28android-wear-9.0.0_r27android-wear-9.0.0_r26android-wear-9.0.0_r25android-wear-9.0.0_r24android-wear-9.0.0_r23android-wear-9.0.0_r22android-wear-9.0.0_r21android-wear-9.0.0_r20android-wear-9.0.0_r2android-wear-9.0.0_r19android-wear-9.0.0_r18android-wear-9.0.0_r17android-wear-9.0.0_r16android-wear-9.0.0_r15android-wear-9.0.0_r14android-wear-9.0.0_r13android-wear-9.0.0_r12android-wear-9.0.0_r11android-wear-9.0.0_r10android-wear-9.0.0_r1android-p-preview-3android-p-preview-2android-9.0.0_r47android-9.0.0_r46android-9.0.0_r45android-9.0.0_r44android-9.0.0_r43android-9.0.0_r42android-9.0.0_r41android-9.0.0_r40android-9.0.0_r39android-9.0.0_r38android-9.0.0_r37android-9.0.0_r36android-9.0.0_r35android-9.0.0_r34android-9.0.0_r33android-9.0.0_r32android-9.0.0_r31android-9.0.0_r30android-9.0.0_r22android-9.0.0_r21android-9.0.0_r20android-9.0.0_r19android-9.0.0_r16android-9.0.0_r12android-9.0.0_r11pie-qpr3-s1-releasepie-qpr3-releasepie-qpr3-b-releasepie-qpr2-releasepie-qpr1-s3-releasepie-qpr1-s2-releasepie-qpr1-s1-releasepie-qpr1-releasepie-dr1-releasepie-dr1-devpie-devpie-b4s4-releasepie-b4s4-devLorenzo Colitti
ef18ea8cd8 am: ff27a837e6 Change-Id: I9bbf3abcb11c1f81c33de67dbe8ea88898fe8fa5
2017-11-24Merge changes Id0db30f6,I117dcabd,If21f95e2,I42c1ebfa am: 550751fdb7Lorenzo Colitti
am: ef18ea8cd8 Change-Id: I53ed491ce401e09246263c69e91c1bbbb026fe8b
2017-11-24Merge changes Id0db30f6,I117dcabd,If21f95e2,I42c1ebfaLorenzo Colitti
am: 550751fdb7 Change-Id: If3fa4cb7c9d04bad4a68341707d074c9e8ec1393
2017-11-24Merge changes Id0db30f6,I117dcabd,If21f95e2,I42c1ebfaLorenzo Colitti
* changes: Always use the bionic UAPI includes for iproute2. Adjust iproute2 v4.14 to compile on android iproute2: fixes to compile on some systems. Update to iproute v4.14
2017-11-22Always use the bionic UAPI includes for iproute2.Lorenzo Colitti
On some products, the system include patch lists vendor-specific include directories (e.g., hardware/qcom/msm8996) before the bionic include paths. This causes us to pick up versions of critical include files, such as <linux/netlink.h>, which are too old to build iproute2. Fix the iproute2 makefiles to explicitly list the bionic UAPI include directory first. Test: aosp_walleye-eng builds Test: aosp_marlin-eng builds Change-Id: Id0db30f6aed0dd64b6d26a6e88d84798a78c6ab9
2017-11-22Adjust iproute2 v4.14 to compile on androidLorenzo Colitti
1. Update the list of files to compile. 2. Add -Wno-int-conversion to avoid compile error. 3. #ifdef out the call to getpass, which bionic does not support. 4. #ifdef out the #warning that says that libmnl is not present, since android does not include it. 5. Fix a sizeof printf format specifier from %lu to %zu. This is not being sent upstream because upstream code has since changed. Test: aosp_walleye-eng builds Test: basic iproute operations (listing rules/routes, configuring addresses) work Change-Id: I117dcabdf1396d1607167ed36991b2999804de47
2017-11-21iproute2: fixes to compile on some systems.Lorenzo Colitti
1. Put the declarations of strlcpy and strlcat inside an #ifdef NEED_STRLCPY. Their declarations were already in a similar #ifdef. 2. In bpf_scm.h, include sys/un.h for struct sockaddr_un. 3. In utils.h, include time.h for struct timeval. [Cherry-pick of upstream 05b3b344b2498d600ca2ad482778b64891fe6bf7] Tested: builds on ubuntu 14.04 with "make clean distclean; ./configure && make -j64" Tested: 4.14.1 builds on Android with Android-specific #ifndefs for missing library code Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Change-Id: If21f95e2e8d87c7d42f8493d5ae70a12b634d065
2017-11-17Update to iproute v4.14Lorenzo Colitti
This merges upstream commit 212b52299e90a369373b9e38924b9492df695559 Change-Id: I42c1ebfa155829de826df415a5d3c2fea606fe26
2017-11-13v4.14.1Stephen Hemminger
2017-11-13utils: remove duplicate include of ctype.hStephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-11-13ip: Fix compilation break on old systemsLeon Romanovsky
As was reported [1], the iproute2 fails to compile on old systems, in Cong's case, it was Fedora 19, in our case it was RedHat 7.2, which failed with the following errors during compilation: ipxfrm.c: In function ‘xfrm_selector_print’: ipxfrm.c:479:7: error: ‘IPPROTO_MH’ undeclared (first use in this function) case IPPROTO_MH: ^ ipxfrm.c:479:7: note: each undeclared identifier is reported only once for each function it appears in ipxfrm.c: In function ‘xfrm_selector_upspec_parse’: ipxfrm.c:1345:8: error: ‘IPPROTO_MH’ undeclared (first use in this function) case IPPROTO_MH: ^ make[1]: *** [ipxfrm.o] Error 1 The reason to it is the order of headers files. The IPPROTO_MH field is set in kernel's UAPI header file (in6.h), but only in case __UAPI_DEF_IPPROTO_V6 is set before. That define comes from other kernel's header file (libc-compat.h) and is set in case there are no previous libc relevant declarations. In ip code, the include of <netdb.h> causes to indirect inclusion of <netinet/in.h> and it sets __UAPI_DEF_IPPROTO_V6 to be zero and prevents from IPPROTO_MH declaration. This patch takes the simplest possible approach to fix the compilation error by checking if IPPROTO_MH was defined before and in case it wasn't, it defines it to be the same as in the kernel. [1] https://www.spinics.net/lists/netdev/msg463980.html Cc: Cong Wang <xiyou.wangcong@gmail.com> Cc: Riad Abo Raed <riada@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
2017-11-12v4.14.0Stephen Hemminger
2017-11-12devlink: add batch command supportIvan Vecera
The patch adds support to batch devlink commands. Cc: Jiri Pirko <jiri@mellanox.com> Cc: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com> Acked-by: Jiri Pirko <jiri@mellanox.com>
2017-11-12lib: make resolve_hosts variable commonIvan Vecera
Any iproute utility that uses any function from lib/utils.c needs to declare its own resolve_hosts variable instance although it does not need/use hostname resolving functionality (currently only 'ip' and 'ss' commands uses this). The patch declares single common instance of resolve_hosts directly in utils.c so the existing ones can be removed (the same approach that is used for timestamp_short). Cc: Jiri Pirko <jiri@mellanox.com> Cc: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
2017-11-12tc: distinguish Add/Replace qdisc operationsRoman Mashak
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
2017-11-12update kernel headersStephen Hemminger
To 4.14 final kernel version Note: SPDX tag added by upstream Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-11-07xfrm_{state, policy}: Allow to deleteall polices/states with marksThomas Egerer
Using 'ip deleteall' with policies that have marks, fails unless you eplicitely specify the mark values. This is very uncomfortable when bulk-deleting policies and states. With this patch all relevant states and policies are wiped by 'ip deleteall' regardless of their mark values. Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2017-11-07xfrm_policy: Do not attempt to deleteall a socket policyThomas Egerer
Socket polices are added to a socket using setsockopt(2). They cannot be deleted by iproute2. The attempt to delete them causes an error (EINVAL). To avoid this unnecessary error message all socket policies are skipped in xfrm_policy_keep. Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2017-11-07xfrm_policy: Add filter option for socket policiesThomas Egerer
Listing policies on systems with a lot of socket policies can be confusing due to the number of returned polices. Even if socket polices are not of interest, they cannot be filtered. This patch adds an option to filter all socket policies from the output. Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2017-11-01ss: Fix width calculations when Netid or State columns are missingStefano Brivio
If Netid or State columns are missing, we must not subtract one for each of these two columns from the remaining screen width, while distributing available space to columns. This one character corresponding to one delimiting space has to be subtracted only if the columns are actually printed. Further, in the existing implementation, if the screen width is an odd number, one additional character is added to the width of one of the two columns. But if both are not printed, this filling character needs to be added somewhere else, in order to have the right spacing allowing us to fill lines completely. Address and port fields are printed in pairs (local and remote), so we can't distribute the space to any of them, because it would be doubled. Instead, print this additional space to the right of the Send-Q column, to keep code changes to a minimum. This is particularly visible with 'ss -f netlink -Z'. Before this patch, with an 80 column terminal, we have: $ ss -f netlink -Z|head -n3 Recv-Q Send-Q Local Address:Port Peer Address:Port 0 0 rtnl:evolution-calen/2049 * pr oc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 0 0 rtnl:clock-applet/1944 * pr oc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 and with an 81 column terminal: $ ss -f netlink -Z|head -n3 Recv-Q Send-Q Local Address:Port Peer Address:Port 0 0 rtnl:evolution-calen/2049 * pro c_ctx=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 0 0 rtnl:clock-applet/1944 * pro c_ctx=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 After this patch, in both cases, the output is: $ ss -f netlink -Z|head -n3 Recv-Q Send-Q Local Address:Port Peer Address:Port 0 0 rtnl:evolution-calen/2049 * proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 0 0 rtnl:clock-applet/1944 * proc_ctx=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2017-11-01ss: Streamline process context printing in netlink_show_one()Stefano Brivio
There's no need to check 'pid_context' before calling free(). Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2017-11-01ss: Remove useless width specifier in process context printStefano Brivio
Both local address and service, and remote address and service fields are already printed out in netlink_show_one() before we start printing process context, by calling sock_addr_print() twice. At this point, sock_addr_print() has already forced the remote service field to be 'serv_width' wide -- that is, 'serv_width' width has already been consumed, before we print process context. Hence, it makes no sense to force the display width of process context to be 'serv_width' wide again: previous prints have filled up the line already. Remove the width specifier and prefix with a space instead, to keep this consistent with fields which are displayed after the first output line. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2017-11-01ip netns: use strtol() instead of atoi()Roman Mashak
Use strtol-based API to parse and validate integer input; atoi() does not detect errors and may yield undefined behaviour if result can't be represented. v2: use get_unsigned() since network namespace is really an unsigned value. Signed-off-by: Roman Mashak <mrv@mojatatu.com>
2017-10-31Update kernel headers based on 4.14-rc7Stephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-10-31tc: m_ife: fix match tcindex parsingAlexander Aring
This patch changes ife_prio to ife_tcindex which is right variable to assign in the argument in this case. Signed-off-by: Alexander Aring <aring@mojatatu.com>
2017-10-31ip: added missing newline in man pageRoman Mashak
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
2017-10-27bridge: checkpatch related cleanupsStephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-10-26bridge: request vlans along with link informationRoman Mashak
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
2017-10-26bridge: dump vlan table information for linkRoman Mashak
Kernel also reports vlans a port is member of, so print it. Since vlan table can be quite large, dump it only when detailed information is requested. Signed-off-by: Roman Mashak <mrv@mojatatu.com>
2017-10-26bridge: isolate vlans parsing code in a separate APIRoman Mashak
IFLA_BRIDGE_VLAN_INFO parsing logic will be used in link and vlan processing code, so it makes sense to move it in the separate function. Signed-off-by: Roman Mashak <mrv@mojatatu.com>
2017-10-26man: add additional explainations for ssyupeng
Add detail explains of -m, -o, -e and -i options, which are not documented anywhere Signed-off-by: yupeng <yupeng0921@gmail.com> Acked-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
2017-10-25tc/actions: introduce support for jump actionJamal Hadi Salim
Sample use case: ... add ingress qdisc sudo $TC qdisc add dev $ETH ingress ... if we exceed rate of 1kbps (burst of 90K), do an absolute jump of 2 actions sudo $TC actions add action police rate 1kbit burst 90k conform-exceed jump 2 / pipe sudo $TC -s actions ls action police action order 0: police 0x4 rate 1Kbit burst 23440b mtu 2Kb action jump 2/pipe overhead 0b ref 1 bind 0 installed 41 sec used 41 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 ... lets add a couple of marks so we can use them to mark exceed/not exceed sudo $TC actions add action skbedit mark 11 ok index 11 sudo $TC actions add action skbedit mark 12 ok index 12 ... if we dont exceed our rate we get a mark of 11, else mark of 12 sudo $TC filter add dev $ETH parent ffff: protocol ip prio 8 u32 \ match ip dst 127.0.0.8/32 flowid 1:10 \ action police index 4 \ action skbedit index 11 \ action skbedit index 12 Ok, lets keep this thing a little busy.. sudo ping -f -c 10000 127.0.0.8 ... now lets see the filters.. sudo $TC -s filter ls dev $ETH parent ffff: protocol ip filter pref 8 u32 chain 0 filter pref 8 u32 chain 0 fh 800: ht divisor 1 filter pref 8 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 not_in_hw (rule hit 20000 success 10000) match 7f000008/ffffffff at 16 (success 10000 ) action order 1: police 0x4 rate 1Kbit burst 23440b mtu 2Kb action jump 2/pipe overhead 0b ref 2 bind 1 installed 198 sec used 2 sec Action statistics: Sent 840000 bytes 10000 pkt (dropped 0, overlimits 9721 requeues 0) backlog 0b 0p requeues 0 action order 2: skbedit mark 11 pass index 11 ref 2 bind 1 installed 127 sec used 2 sec Action statistics: Sent 23436 bytes 279 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 action order 3: skbedit mark 12 pass index 12 ref 2 bind 1 installed 127 sec used 2 sec Action statistics: Sent 816564 bytes 9721 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 As can be seen 97.21% of the packets were marked as exceeding the allocated rate; you could do something clever with the skb mark after this. Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-10-23ss: initialize 'fackets' member of tcpstat structureRoman Mashak
'fackets' has never been initialized with kernel extracted information, thus never really printed. Signed-off-by: Roman Mashak <mrv@mojatatu.com>
2017-10-21ip maddr: fix filtering by deviceMichal Kubecek
Commit 530903dd9003 ("ip: fix igmp parsing when iface is long") uses variable len to keep trailing colon from interface name comparison. This variable is local to loop body but we set it in one pass and use it in following one(s) so that we are actually using (pseudo)random length for comparison. This became apparent since commit b48a1161f5f9 ("ipmaddr: Avoid accessing uninitialized data") always initializes len to zero so that the name comparison is always true. As a result, "ip maddr show dev eth0" shows IPv4 multicast addresses for all interfaces. Instead of keeping the length, let's simply replace the trailing colon with a null byte. The bonus is that we get correct interface name in ma.name. Fixes: 530903dd9003 ("ip: fix igmp parsing when iface is long") Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Acked-by: Phil Sutter <phil@nwl.cc> Acked-by: Petr Vorel <pvorel@suse.cz>
2017-10-21ss: Detect IPPROTO_ICMPV6 socketsPhil Sutter
Prefix IPPROTO_ICMPV6 sockets with 'icmp6' instead of '???'. Signed-off-by: Phil Sutter <phil@nwl.cc>
2017-10-21ss: Distinguish between IPv4 and IPv6 wildcard socketsPhil Sutter
Commit aba9c23a6e1cb ("ss: enclose IPv6 address in brackets") unified display of wildcard sockets in IPv4 and IPv6 to print the unspecified address as '*'. Users then complained that they can't distinguish between address families anymore, so change this again to what Stephen Hemminger suggested: | *:80 << both IPV6 and IPV4 | [::]:80 << IPV6_ONLY | 0.0.0.0:80 << IPV4_ONLY Note that on older kernels which don't support INET_DIAG_SKV6ONLY attribute, pure IPv6 sockets will still show as '*'. Cc: Humberto Alves <hjalves@live.com> Cc: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Phil Sutter <phil@nwl.cc>
2017-10-18Merge branch 'master' of ↵Stephen Hemminger
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2
2017-10-16color: Rename enumPetr Vorel
COLOR_NONE is more descriptive than COLOR_CLEAR. Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2017-10-16color: Cleanup code to remove "magic" offset + 7Petr Vorel
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2017-10-16color: Fix another ip segfault when using --color switchPetr Vorel
Commit 959f1428 ("color: add new COLOR_NONE and disable_color function") introducing color enum COLOR_NONE, which is not only duplicite of COLOR_CLEAR, but also caused segfault, when running ip with --color switch, as 'attr + 8' in color_fprintf() access array item out of bounds. Thus removing it and restoring "magic" offset + 7. Reproduce with: $ ip -c a Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2017-10-16color: Fix ip segfault when using --color switchPetr Vorel
Commit d0e72011 ("ip: ipaddress.c: add support for json output") introduced passing -1 as enum color_attr. This is not only wrong as no color_attr has value -1, but also causes another segfault in color_fprintf() on this setup as there is no item with index -1 in array of enum attr_colors[]. Using COLOR_CLEAR is valid option. Reproduce with: $ COLORFGBG='0;15' ip -c a NOTE: COLORFGBG is environmental variable used for defining whether user has light or dark background. COLORFGBG="0;15" is used to ask for color set suitable for light background, COLORFGBG="15;0" is used to ask for color set suitable for dark background. Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2017-10-16tests: Revert back /bin/sh in shebangPetr Vorel
This was added by mistake in commit ecd44e68 ("tests: Remove bashisms (s/source/.)") Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2017-10-11netem: fix code indentationStephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-10-11ss: print MD5 signature keys configured on TCP socketsIvan Delalande
These keys are reported by kernel 4.14 and later under the INET_DIAG_MD5SIG attribute, when INET_DIAG_INFO is requested (ss -i) and we have CAP_NET_ADMIN. The additional output looks like: md5keys:fe80::/64=signing_key,10.1.2.0/24=foobar,::1/128=Test Signed-off-by: Ivan Delalande <colona@arista.com>
2017-10-11utils: add print_escape_buf to format and print arbitrary bytesIvan Delalande
Keep it as simple as possible for now: just escape anything that is not isprint-able, is among the "escape" parameter or '\' as an octal escape sequence. This should be pretty easy to extend if any other user needs something more complex in the future. Signed-off-by: Ivan Delalande <colona@arista.com>
2017-10-11lib: fix multiple strlcpy definitionBaruch Siach
Some C libraries, like uClibc and musl, provide BSD compatible strlcpy(). Add check_strlcpy() to configure, and avoid defining strlcpy and strlcat when the C library provides them. This fixes the following static link error with uClibc-ng: .../sysroot/usr/lib/libc.a(strlcpy.os): In function `strlcpy': strlcpy.c:(.text+0x0): multiple definition of `strlcpy' ../lib/libutil.a(utils.o):utils.c:(.text+0x1ddc): first defined here collect2: error: ld returned 1 exit status Acked-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2017-10-11tests: Remove bashisms (s/source/.)Petr Vorel
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2017-10-11rdma: move headers to uapiStephen Hemminger
And update with version from upstream. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-10-11iproute: build more easily on AndroidLorenzo Colitti
iproute2 contains a bunch of kernel headers, including uapi ones. Android's libc uses uapi headers almost directly, and uses a script to fix kernel types that don't match what userspace expects. For example: https://issuetracker.google.com/36987220 reports that our struct ip_mreq_source contains "__be32 imr_multiaddr" rather than "struct in_addr imr_multiaddr". The script addresses this by replacing the uapi struct definition with a #include <bits/ip_mreq.h> which contains the traditional userspace definition. Unfortunately, when we compile iproute2, this definition conflicts with the one in iproute2's linux/in.h. Historically we've just solved this problem by running "git rm" on all the iproute2 include/linux headers that break Android's libc. However, deleting the files in this way makes it harder to keep up with upstream, because every upstream change to an include file causes a merge conflict with the delete. This patch fixes the problem by moving the iproute2 linux headers from include/linux to include/uapi/linux. Tested: compiles on ubuntu trusty (glibc) Signed-off-by: Elliott Hughes <enh@google.com> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
2017-10-11tipc: don't need custom CFLAGSStephen Hemminger
Since libmnl CFLAGS are now handled by config.mk Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>