- 26 Jun, 2015 1 commit
-
-
Daniel Borkmann authored
Add a start of a man-page to the misc section as a reference and guide on (e)BPF classifier and actions. Given that tc is only tersely documented, this is provided in the hope that users will have an easier getting started with tc and (e)BPF. And, that there's now more incentive for others to also start documenting their classifier and actions as well. ;) Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@plumgrid.com>
-
- 25 Jun, 2015 11 commits
-
-
Maciej Żenczykowski authored
s->local.data is a pointer to a field of a non-NULL struct, and hence cannot be NULL, thus comparing it to 0 is always false, and thus the return is always false. Presumably this was meant to be a check whether s->local.data[0] (which I believe stores af_packet protocol) is 0, ie. ANY. Change-Id: Ia232f5b06ce081e3b2fb6338f1a709cd94e03ae5 Fixes: ss.c:1018:37: error: comparison of array 's->local.data' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare] return s->lport == 0 && s->local.data == 0; ~~~~~~~~~^~~~ ~ 1 error generated.
-
Maciej Żenczykowski authored
The initializers are simply not needed. These if-blocks are outright dead code, because '0 > unsigned' is always false, so only else clause triggers and regardless of which clause triggers it only updates 'ind' which is later unconditionally written to before being used anyway. Otherwise we get errors from clang: m_pedit.c:166:8: error: comparison of 0 > unsigned expression is always false [-Werror,-Wtautological-compare] if (0 > tkey->off) { ~ ^ ~~~~~~~~~ m_pedit.c:209:8: error: comparison of 0 > unsigned expression is always false [-Werror,-Wtautological-compare] if (0 > tkey->off) { ~ ^ ~~~~~~~~~ 2 errors generated. Change-Id: I3c9e9092915088fc56f992e5df736851541a4458
-
Mazhar Rana authored
The command "ip mroute show" is not showing routes when "to" and/or "from" filter is applied. root@mazhar:~# ip mroute show (10.202.30.101, 235.1.2.3) Iif: eth0 Oifs: eth1 But When I applied filter, it does not show anything. root@mazhar:~# ip mroute show 235.1.2.3 from 10.202.30.101 root@mazhar:~# Signed-off-by: Mazhar Rana <ranamazharp@gmail.com>
-
Thadeu Lima de Souza Cascardo authored
If a tunnel is created with a local address, you can't change it to any. # ip tunnel add tunl1 mode ipip remote 10.16.42.37 local 10.16.42.214 ttl 64 # ip tunnel show tunl1 tunl1: ip/ip remote 10.16.42.37 local 10.16.42.214 ttl 64 # ip tunnel change tunl1 local any # echo $? 0 # ip tunnel show tunl1 tunl1: ip/ip remote 10.16.42.37 local 10.16.42.214 ttl 64 It happens that parse_args zeroes ip_tunnel_parm, and when creating the tunnel, it is OK to leave it as is if the address is any. However, when changing the tunnel, the current parameters will be read from ip_tunnel_parm, and local and remote address won't be zeroes anymore, so it needs to be explicitly set to any. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
-
Vadim Kochan authored
Added possibility to check command output by grep from the testing script. Now TMP_OUT & TMP_ERR are passed from Makefile and changed to STD_ERR & STD_OUT. Also changed some existing tests to make output testing. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Daniel Borkmann authored
The for loop should only probe up to G[i]bit rates, so that we end up with T[i]bit as the last max units[] slot for snprintf(3), and not possibly an invalid pointer in case rate is multiple of kilo. Fixes: 8cecdc28 ("tc: more user friendly rates") Reported-by: Jose R. Guzman Mosqueda <jose.r.guzman.mosqueda@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-
Eric Dumazet authored
ss currently dumps IPv4 sockets, then IPv6 sockets from the kernel, even if -4 or -6 option was given. Filtering in user space then has to drop all sockets of wrong family. Such a waste of time... Before : $ time ss -tn -4 | wc -l 251659 real 0m1.241s user 0m0.423s sys 0m0.806s After: $ time ss -tn -4 | wc -l 251672 real 0m0.779s user 0m0.412s sys 0m0.386s Signed-off-by: Eric Dumazet <edumazet@google.com>
-
Eric Dumazet authored
Lets implement a full cache with proper hash table, memory got cheaper these days. Before : $ time ss -t | wc -l 529678 real 0m22.708s user 0m19.591s sys 0m2.969s After : $ time ss -t | wc -l 528291 real 0m5.078s user 0m4.099s sys 0m0.985s Signed-off-by: Eric Dumazet <edumazet@google.com>
-
Eric Dumazet authored
On Fri, 2015-05-29 at 13:30 +0300, Vadim Kochan wrote: > From: Vadim Kochan <vadim4j@gmail.com> > > Use strdup instead of malloc, and get rid of bad strcpy. > > Signed-off-by: Vadim Kochan <vadim4j@gmail.com> > --- > misc/ss.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/misc/ss.c b/misc/ss.c > index 347e3a1..a719466 100644 > --- a/misc/ss.c > +++ b/misc/ss.c > @@ -1908,8 +1908,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r, > > if (tb[INET_DIAG_CONG]) { > const char *cong_attr = rta_getattr_str(tb[INET_DIAG_CONG]); > - s.cong_alg = malloc(strlen(cong_attr + 1)); > - strcpy(s.cong_alg, cong_attr); > + s.cong_alg = strdup(cong_attr); > } > > if (TCPI_HAS_OPT(info, TCPI_OPT_WSCALE)) { I doubt TCP_CA_NAME_MAX will ever change in the kernel : 16 bytes. Its typically "cubic" and less than 8 bytes. Using 8 bytes to point to a malloc(8) is a waste. Please remove the memory allocation, or store the pointer, since tcp_show_info() does the malloc()/free() before return.
-
Vadim Kochan authored
Indicate existence of libmnl which is required by tipc. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Mike Frysinger authored
Make sure we use 64-bit filesystem functions everywhere. This applies not only to being able to read large files (which generally doesn't apply to us), but also being able to simply stat them (as they might be using large inodes). Signed-off-by: Mike Frysinger <vapier@chromium.org>
-
- 28 May, 2015 2 commits
-
-
Stephen Hemminger authored
The definition of offload flag changed during 4.1 rc process.
-
Stephen Hemminger authored
Pull in some changes like RTN_F_EXTERNAL
-
- 27 May, 2015 2 commits
-
-
Stephen Hemminger authored
There have been several instances where response from kernel has overrun the stack buffer from the caller. Avoid future problems by passing a size argument. Also drop the unused peer and group arguments to rtnl_talk.
-
Jetchko Jekov authored
Now it matches the size for the answer defined in rtnl_talk() and prevents stack corruption with answer > 1024 bytes.
-
- 21 May, 2015 14 commits
-
-
Vadim Kochan authored
Print such info like version, tx/rx ring, fanout for packet sockets when '-e' option was specified. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Vadim Kochan authored
Changed to forcely running each test in network namespace to do not affect on current network setup. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
Richard Alpe authored
tipc is a user-space configuration tool for TIPC (Transparent Inter-process Communication). It utilizes the TIPC netlink API in the kernel to fetch data or perform actions. The tipc tool has somewhat similar syntax to the ip tool meaning that users of the ip tool should not feel that unfamiliar with this tool. Signed-off-by: Richard Alpe <richard.alpe@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
-
Stephen Hemminger authored
Also add tipc_netlink.h for later TIPC support
-
David Ward authored
In the GRED kernel source code, both of the terms "drop parameters" (DP) and "virtual queue" (VQ) are used to refer to the same thing. Each "DP" is better understood as a "set of drop parameters", since it has values for limit, min, max, avpkt, etc. This terminology can result in confusion when creating a GRED qdisc having multiple DPs. Netlink attributes and struct members with the DP name seem to have been left intact for compatibility, while the term VQ was otherwise adopted in the code, which is more intuitive. Use the VQ term in the tc command syntax and output (but maintain compatibility with the old syntax). Rewrite the usage text to be concise and similar to other qdiscs. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
DPs, def_DP, and DP are unsigned values that are sent and received in TCA_GRED_* netlink attributes; handle them properly when they are parsed or printed. Use MAX_DPs as the initial value for def_DP and DP, and fix the operator used for bounds checking them. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
Make the output more consistent with the RED qdisc, and only show details/statistics if the appropriate flag is set when calling tc. Show the parameters used with "gred setup". Add missing statistics "pdrop" and "other". Fix format specifiers for unsigned values. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
This is more helpful to the user, since the command takes two forms, and the message that would otherwise appear about missing parameters assumes one of those forms. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
The "bandwidth" parameter is optional, but ensure the user is aware of its default value, to proactively avoid configuration problems. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
burst is an unsigned value. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
David Ward authored
It is used when parsing three different parameters, only one of which is Wlog. Change the name to make the code less confusing. Signed-off-by: David Ward <david.ward@ll.mit.edu>
-
- 14 May, 2015 1 commit
-
-
Vadim Kochan authored
Remove double explanation of GROUP option from 'ip link set' section. Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
-
- 11 May, 2015 7 commits
-
-
Lennert Buytenhek authored
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
-
Daniel Borkmann authored
Fix whitespacing and remove the unnecessary condition. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-
Eric Dumazet authored
Missing space before dctcp: markers. With dctcp, cwnd=2 is pretty common, just display cwnd value even if cwnd has this value, it makes parsing easier. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
-
Eric Dumazet authored
Kernel can give us smaller tcp_info than our. We copy the kernel provided structure and fill with 0 the remaining part. Lets clear only the missing part to save some cycles, as we intend to slightly increase tcp_info size in the future. Signed-off-by: Eric Dumazet <edumazet@google.com>
-
Thomas Graf authored
Signed-off-by: Thomas Graf <tgraf@suug.ch>
-
WANG Cong authored
When deleting a specific basic filter with handle, tc command always ignores the 'handle' option, so tcm_handle is always 0 and kernel deletes all filters in the selected group. This is wrong, we should respect 'handle' in cmdline. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
-
Thomas Graf authored
Fixes a typo in get_prefix_1() which broke the prefix default names { default | any | all }. The most obvious fallout from this bug was: $ ip route add default via 1.1.1.1 Error: an inet prefix is expected rather than "default". Fixes: dacc5d41 ("add basic mpls support to iproute") Signed-off-by: Thomas Graf <tgraf@suug.ch>
-
- 07 May, 2015 2 commits
-
-
Stephen Hemminger authored
The exit code for ip label was not correct. The return from the command function is negated and turned into the exit code on failure.
-
Stephen Hemminger authored
If ip rule command fails talking to kernel, exit code should be 2. The sub-command is called by cmd loop and the exit code is negative of return value from the command callback.
-