[PATCH iproute2 0/2] lib: bpf_legacy: some misc fixes

2021-04-19 Thread Andrea Claudi
This patch set fixes two issues on bpf_legacy library code. - 1/2 fixes a covscan warning about a possible missing close() treating 0 as a valid file descriptor, as almost elsewhere in iproute2 code. - 2/2 fixes a missing close() on a socket in some error paths in two functions. Andrea Claudi

[PATCH iproute2 2/2] lib: bpf_legacy: fix missing socket close when connect() fails

2021-04-19 Thread Andrea Claudi
pport for cls and act front-end") Signed-off-by: Andrea Claudi --- lib/bpf_legacy.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c index 7ff10e4f..7ec9ce9d 100644 --- a/lib/bpf_legacy.c +++ b/lib/bpf_legacy.c @

[PATCH iproute2 1/2] lib: bpf_legacy: treat 0 as a valid file descriptor

2021-04-19 Thread Andrea Claudi
error reporting around tail calls") Signed-off-by: Andrea Claudi --- lib/bpf_legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c index 8a03b9c2..7ff10e4f 100644 --- a/lib/bpf_legacy.c +++ b/lib/bpf_legacy.c @@ -2832,7 +2832,7 @@ s

[PATCH iproute2] ip: netns: fix missing netns close on some error paths

2021-04-19 Thread Andrea Claudi
In functions netns_pids() and netns_identify_pid(), the netns file is not closed on some error paths. Fix this using a conditional close and a single return point on both functions. Fixes: 44b563269ea1 ("ip-nexthop: support flush by id") Signed-off-by: Andrea Claudi --- ip/ipne

[PATCH iproute2] tc: e_bpf: fix memory leak in parse_bpf()

2021-04-19 Thread Andrea Claudi
envp_run is dinamically allocated with a malloc, and not freed in the out: return path. This commit fix it. Signed-off-by: Andrea Claudi --- tc/e_bpf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tc/e_bpf.c b/tc/e_bpf.c index a48393b7..517ee5b3 100644 --- a/tc/e_bpf.c

[PATCH iproute2] lib: move get_task_name() from rdma

2021-04-19 Thread Andrea Claudi
The function get_task_name() is used to get the name of a process from its pid, and its implementation is similar to ip/iptuntap.c:pid_name(). Move it to lib/fs.c to use a single implementation and make it easily reusable. Signed-off-by: Andrea Claudi --- include/utils.h | 1 + ip/iptuntap.c

[PATCH iproute2] rdma: stat: fix return code

2021-04-18 Thread Andrea Claudi
libmnl defines MNL_CB_OK as 1 and MNL_CB_ERROR as -1. rdma uses these return codes, and stat_qp_show_parse_cb() should do the same. Fixes: 16ce4d23661a ("rdma: stat: initialize ret in stat_qp_show_parse_cb()") Reported-by: Leon Romanovsky Signed-off-by: Andrea Claudi --- rdma/stat.c

Re: [PATCH iproute2] rdma: stat: initialize ret in stat_qp_show_parse_cb()

2021-04-18 Thread Andrea Claudi
On Sun, Apr 18, 2021 at 1:07 PM Leon Romanovsky wrote: > > On Wed, Apr 14, 2021 at 12:50:57AM +0200, Andrea Claudi wrote: > > In the unlikely case in which the mnl_attr_for_each_nested() cycle is > > not executed, this function return an uninitialized value. > > > >

[PATCH iproute2] rdma: stat: initialize ret in stat_qp_show_parse_cb()

2021-04-13 Thread Andrea Claudi
In the unlikely case in which the mnl_attr_for_each_nested() cycle is not executed, this function return an uninitialized value. Fix this initializing ret to 0. Fixes: 5937552b42e4 ("rdma: Add "stat qp show" support") Signed-off-by: Andrea Claudi --- rdma/stat.c | 2 +

[PATCH iproute2] nexthop: fix memory leak in add_nh_group_attr()

2021-04-13 Thread Andrea Claudi
grps is dinamically allocated with a calloc, and not freed in a return path in the for cycle. This commit fix it. While at it, make the function use a single return point. Fixes: 63df8e8543b0 ("Add support for nexthop objects") Signed-off-by: Andrea Claudi --- ip/ipnext

[PATCH iproute2] q_cake: remove useless check on argv

2021-04-13 Thread Andrea Claudi
In cake_parse_opt(), *argv is checked not to be null when parsing for overhead and mpu parameters. However this is useless, since *argv matches right before for "overhead" or "mpu". Signed-off-by: Andrea Claudi --- tc/q_cake.c | 5 ++--- 1 file changed, 2 insertions(+),

[PATCH iproute2] devlink: always check strslashrsplit() return value

2021-04-13 Thread Andrea Claudi
the same time") Signed-off-by: Andrea Claudi --- devlink/devlink.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index c6e85ff9..faa87b3d 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -965,7 +965,13 @@ static int

[PATCH iproute2] tc: m_gate: use SPRINT_BUF when needed

2021-02-22 Thread Andrea Claudi
gate control action") Signed-off-by: Andrea Claudi --- tc/m_gate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tc/m_gate.c b/tc/m_gate.c index 892775a3..c091ae19 100644 --- a/tc/m_gate.c +++ b/tc/m_gate.c @@ -427,7 +427,7 @@ static int print_gate_list(struct rt

[PATCH iproute2] ip: lwtunnel: seg6: bail out if table ids are invalid

2021-02-22 Thread Andrea Claudi
SRv6 End.DT* behaviors") Fixes: 69629b4e43c4 ("seg6: add support for vrftable attribute in SRv6 End.DT4/DT6 behaviors") Signed-off-by: Andrea Claudi --- ip/iproute_lwtunnel.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ip/iproute_lwtunnel.c b/ip/ipro

[PATCH iproute2 v2 0/2] Some fixes to lib/fs.c

2021-02-22 Thread Andrea Claudi
by Phil Sutter and his Acked-by; - on 2/2, simplify changes using conditional close() calls, as suggested by Phil Sutter. Andrea Claudi (2): lib/fs: avoid double call to mkdir on make_path() lib/fs: Fix single return points for get_cgroup2_* lib/fs.c | 17 ++--- 1 file changed,

[PATCH iproute2 v2 2/2] lib/fs: Fix single return points for get_cgroup2_*

2021-02-22 Thread Andrea Claudi
: d5e6ee0dac64 ("ss: introduce cgroup2 cache and helper functions") Fixes: 8f1cd119b377 ("lib: fix checking of returned file handle size for cgroup") Signed-off-by: Andrea Claudi --- lib/fs.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/f

[PATCH iproute2 v2 1/2] lib/fs: avoid double call to mkdir on make_path()

2021-02-22 Thread Andrea Claudi
plify make_path()") Acked-by: Phil Sutter Signed-off-by: Andrea Claudi --- lib/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fs.c b/lib/fs.c index 4b90a704..2ae506ec 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -253,7 +253,7 @@ int make_path(const char *path, m

[PATCH iproute2] lib/bpf: Fix and simplify bpf_mnt_check_target()

2021-02-22 Thread Andrea Claudi
but EEXIST. Fixes: 95ae9a4870e7 ("bpf: fix mnt path when from env") Signed-off-by: Andrea Claudi --- lib/bpf_legacy.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c index bc869c3f..8a03b9c2 100644 --- a/lib/bp

[PATCH iproute2] lib/namespace: fix ip -all netns return code

2021-02-22 Thread Andrea Claudi
s") Reported-by: Jianlin Shi Signed-off-by: Andrea Claudi --- lib/namespace.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/namespace.c b/lib/namespace.c index 06ae0a48..45a7dedd 100644 --- a/lib/namespace.c +++ b/lib/namespace.c @@ -122,8 +122,14 @@ int netns_fore

Re: [PATCH iproute2 2/2] lib/fs: Fix single return points for get_cgroup2_*

2020-12-18 Thread Andrea Claudi
On Sat, Dec 19, 2020 at 12:08 AM Phil Sutter wrote: > > On Fri, Dec 18, 2020 at 08:09:23PM +0100, Andrea Claudi wrote: > > Functions get_cgroup2_id() and get_cgroup2_path() uncorrectly performs > > cleanup on the single return point. Both of them may get to use close() &

[PATCH iproute2 1/2] lib/fs: avoid double call to mkdir on make_path()

2020-12-18 Thread Andrea Claudi
make_path() function calls mkdir two times in a row. The first one it stores mkdir return code, and then it calls it again to check for errno. This seems unnecessary, as we can use the return code from the first call and check for errno if not 0. Signed-off-by: Andrea Claudi --- lib/fs.c | 2

[PATCH iproute2 0/2] Some fixes to lib/fs.c

2020-12-18 Thread Andrea Claudi
This series contains a couple of fixes and improvements on lib/fs.c - in functions get_cgroup2_id() and get_cgroup2_path(), fixes cleanup on single return point; - in function make_path(), avoid to call mkdir() two times in a row. Andrea Claudi (2): lib/fs: avoid double call to mkdir on

[PATCH iproute2 2/2] lib/fs: Fix single return points for get_cgroup2_*

2020-12-18 Thread Andrea Claudi
. Fixes: d5e6ee0dac64 ("ss: introduce cgroup2 cache and helper functions") Fixes: 8f1cd119b377 ("lib: fix checking of returned file handle size for cgroup") Signed-off-by: Andrea Claudi --- lib/fs.c | 27 +-- 1 file changed, 17 insertions(+), 10 deleti

[PATCH iproute2 2/2] tc: pedit: fix memory leak in print_pedit

2020-12-11 Thread Andrea Claudi
keys_ex is dinamically allocated with calloc on line 770, but is not freed in case of error at line 823. Fixes: 081d6c310d3a ("tc: pedit: Support JSON dumping") Signed-off-by: Andrea Claudi --- tc/m_pedit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tc/m_pe

[PATCH iproute2 0/2] fix two memory leaks

2020-12-11 Thread Andrea Claudi
This series fixes two memory leaks in iproute2, in tc and devlink code. Andrea Claudi (2): devlink: fix memory leak in cmd_dev_flash() tc: pedit: fix memory leak in print_pedit devlink/devlink.c | 13 - tc/m_pedit.c | 4 +++- 2 files changed, 11 insertions(+), 6 deletions

[PATCH iproute2 1/2] devlink: fix memory leak in cmd_dev_flash()

2020-12-11 Thread Andrea Claudi
vlink: implement flash status monitoring") Signed-off-by: Andrea Claudi --- devlink/devlink.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index ca99732e..43549965 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @

[PATCH iproute2] man: tc-flower: fix manpage

2020-12-11 Thread Andrea Claudi
n") Reported-by: Paolo Valerio Signed-off-by: Andrea Claudi --- man/man8/tc-flower.8 | 6 -- 1 file changed, 6 deletions(-) diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8 index da3dd757..1a76b375 100644 --- a/man/man8/tc-flower.8 +++ b/man/man8/tc-flower.8 @@ -1,11 +1,5 @@ .TH &qu

[PATCH iproute2] ss: mptcp: fix add_addr_accepted stat print

2020-11-18 Thread Andrea Claudi
add_addr_accepted value is not printed if add_addr_signal value is 0. Fix this properly looking for add_addr_accepted value, instead. Fixes: 9c3be2c0eee01 ("ss: mptcp: add msk diag interface support") Signed-off-by: Andrea Claudi --- misc/ss.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH iproute2-next] ip address: remove useless include

2020-07-07 Thread Andrea Claudi
utils.h is included two times in ipaddress.c, there is no need for that. Signed-off-by: Andrea Claudi --- ip/ipaddress.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 3b53933f41673..a6acd8acca4a2 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c

Re: [PATCH iproute2] tc: flower: support multiple MPLS LSE match

2020-07-01 Thread Andrea Claudi
On Fri, Jun 19, 2020 at 12:51 PM Guillaume Nault wrote: > > Add the new "mpls" keyword that can be used to match MPLS fields in > arbitrary Label Stack Entries. > LSEs are introduced by the "lse" keyword and followed by LSE options: > "depth", "label", "tc", "bos" and "ttl". The depth is manadtory

[iproute2 PATCH 0/2] Fix segfault in lib/bpf.c

2020-05-26 Thread Andrea Claudi
revert it and fix the warning checking for snprintf return value Andrea Claudi (2): Revert "bpf: replace snprintf with asprintf when dealing with long buffers" bpf: Fixes a snprintf truncation warning lib/bpf.c | 155 +++---

[iproute2 PATCH 1/2] Revert "bpf: replace snprintf with asprintf when dealing with long buffers"

2020-05-26 Thread Andrea Claudi
im Signed-off-by: Andrea Claudi --- lib/bpf.c | 155 ++ 1 file changed, 39 insertions(+), 116 deletions(-) diff --git a/lib/bpf.c b/lib/bpf.c index 10cf9bf44419a..23cb0d96a85ba 100644 --- a/lib/bpf.c +++ b/lib/bpf.c @@ -406,21 +406,13 @@

[iproute2 PATCH 2/2] bpf: Fixes a snprintf truncation warning

2020-05-26 Thread Andrea Claudi
roperly handling the error. Fixes: e42256699cac ("bpf: make tc's bpf loader generic and move into lib") Signed-off-by: Andrea Claudi --- lib/bpf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bpf.c b/lib/bpf.c index 23cb0d96a85ba..c7d45077c14e5 100

Re: [PATCH iproute2 v3 0/2] bpf: memory access fixes

2020-05-25 Thread Andrea Claudi
On Sat, May 23, 2020 at 12:32 PM Jamal Hadi Salim wrote: > > On 2020-05-22 9:33 p.m., Daniel Borkmann wrote: > > On 5/18/20 3:00 PM, Jamal Hadi Salim wrote: > >> ping? > >> > >> Note: these are trivial bug fixes. > > > > Looking at c0325b06382c ("bpf: replace snprintf with asprintf when > > dealin

Re: [PATCH iproute2-next v2] tc: full JSON support for 'bpf' filter

2020-04-30 Thread Andrea Claudi
": 0, > "options": { >"handle": "0x1", >"bpf_name": "filter.o:[tc-ingress]", > "direct-action": true, >"not_in_hw": true, >"prog": { > "i

Re: [PATCH iproute2-next 0/4] iproute: mptcp support

2020-04-28 Thread Andrea Claudi
> misc/ss.c | 62 ++ > 8 files changed, 738 insertions(+), 2 deletions(-) > create mode 100644 include/uapi/linux/mptcp.h > create mode 100644 ip/ipmptcp.c > create mode 100644 man/man8/ip-mptcp.8 > > -- > 2.21.1 > Acked-by: Andrea Claudi

Re: [PATCH iproute2-next] tc: full JSON support for 'bpf' filter

2020-04-28 Thread Andrea Claudi
On Tue, Apr 28, 2020 at 11:00 AM Davide Caratti wrote: > > example using eBPF: > > # tc filter add dev dummy0 ingress bpf \ > > direct-action obj ./bpf/filter.o sec tc-ingress > # tc -j filter show dev dummy0 ingress | jq > [ >{ > "protocol": "all", > "pref": 49152, > "kind

[PATCH iproute2] tc: fix segmentation fault on gact action

2019-10-01 Thread Andrea Claudi
g of gact action by index.") Reported-by: Davide Caratti Signed-off-by: Andrea Claudi --- tc/m_gact.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_gact.c b/tc/m_gact.c index dca2a2f9692fd..b06e8ee95818f 100644 --- a/tc/m_gact.c +++ b/tc/m_gact.c @@ -87,7 +87,7 @@ parse_g

[PATCH iproute2-next v2] bpf: replace snprintf with asprintf when dealing with long buffers

2019-09-16 Thread Andrea Claudi
"%s/", mnt); | ^~ Fixes: e42256699cac ("bpf: make tc's bpf loader generic and move into lib") Signed-off-by: Andrea Claudi --- lib/bpf.c | 155 -- 1 file changed, 116 insertions(+)

[PATCH iproute2-next] man: ss.8: add documentation for drop counter

2019-09-11 Thread Andrea Claudi
After commit 6df9c7a06a845 ("ss: add SK_MEMINFO_DROPS display") ss -m displays also a drop counter for each socket. This commit properly document it into the man page. Signed-off-by: Andrea Claudi --- man/man8/ss.8 | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -

[PATCH iproute2-next] bpf: replace snprintf with asprintf when dealing with long buffers

2019-09-09 Thread Andrea Claudi
"%s/", mnt); | ^~ Fixes: e42256699cac ("bpf: make tc's bpf loader generic and move into lib") Signed-off-by: Andrea Claudi --- lib/bpf.c | 95 +-- 1 file changed, 57 insertions(+)

Re: [PATCH iproute2-next] bpf: fix snprintf truncation warning

2019-09-06 Thread Andrea Claudi
On Thu, Sep 5, 2019 at 5:51 PM Stephen Hemminger wrote: > > On Thu, 5 Sep 2019 13:44:55 +0200 > Andrea Claudi wrote: > > > On Thu, Sep 5, 2019 at 12:15 AM David Ahern wrote: > > > > > > On 9/4/19 9:50 AM, Andrea Claudi wrote: > > > > gcc v9.2.1 p

Re: [PATCH iproute2-next] bpf: fix snprintf truncation warning

2019-09-05 Thread Andrea Claudi
On Thu, Sep 5, 2019 at 12:15 AM David Ahern wrote: > > On 9/4/19 9:50 AM, Andrea Claudi wrote: > > gcc v9.2.1 produces the following warning compiling iproute2: > > > > bpf.c: In function ‘bpf_get_work_dir’: > > bpf.c:784:49: warning: ‘snprintf’ output may be truncat

[PATCH iproute2] devlink: fix segfault on health command

2019-09-04 Thread Andrea Claudi
with DL_OPT_HEALTH_REPORTER_GRACEFUL_PERIOD. Fixes: b18d89195b16 ("devlink: Add devlink health set command") Signed-off-by: Andrea Claudi --- devlink/devlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index 91c85dc1de730

Re: [PATCH iproute2-next] bpf: fix snprintf truncation warning

2019-09-04 Thread Andrea Claudi
On Wed, Sep 4, 2019 at 5:50 PM Andrea Claudi wrote: > > gcc v9.2.1 produces the following warning compiling iproute2: > > bpf.c: In function ‘bpf_get_work_dir’: > bpf.c:784:49: warning: ‘snprintf’ output may be truncated before the last > format character [-Wformat-tr

[PATCH iproute2-next] bpf: fix snprintf truncation warning

2019-09-04 Thread Andrea Claudi
ing bpf_wrk_dir size by 1 byte for the extra "/" char. Signed-off-by: Andrea Claudi --- lib/bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bpf.c b/lib/bpf.c index 7d2a322ffbaec..95de7894a93ce 100644 --- a/lib/bpf.c +++ b/lib/bpf.c @@ -742,7 +742,7 @@ stat

[PATCH iproute2-next v2] ip tunnel: add json output

2019-08-02 Thread Andrea Claudi
Add json support on iptunnel and ip6tunnel. The plain text output format should remain the same. Signed-off-by: Andrea Claudi --- Changes since v1: * Use print_color_* for ifname and ip addresses; * Use print_null() instead of print_bool() where appropriate; * Reduce indentation level on

Re: [PATCH iproute2-next] ip tunnel: add json output

2019-08-02 Thread Andrea Claudi
On Fri, Aug 2, 2019 at 5:49 PM Stephen Hemminger wrote: > > On Fri, 2 Aug 2019 13:14:15 +0200 > Andrea Claudi wrote: > > > On Thu, Aug 1, 2019 at 5:16 PM Stephen Hemminger > > wrote: > > > > > > On Thu, 1 Aug 2019 12:12:58 +0200 > > > Andr

Re: [PATCH iproute2-next] ip tunnel: add json output

2019-08-02 Thread Andrea Claudi
On Thu, Aug 1, 2019 at 5:16 PM Stephen Hemminger wrote: > > On Thu, 1 Aug 2019 12:12:58 +0200 > Andrea Claudi wrote: > > > Add json support on iptunnel and ip6tunnel. > > The plain text output format should remain the same. > > > > Signed-off-by: Andrea Clau

[PATCH iproute2-next] ip tunnel: add json output

2019-08-01 Thread Andrea Claudi
Add json support on iptunnel and ip6tunnel. The plain text output format should remain the same. Signed-off-by: Andrea Claudi --- ip/ip6tunnel.c | 82 +++-- ip/iptunnel.c | 90 +- ip/tunnel.c| 42

[PATCH iproute2] tc: util: constrain percentage in 0-100 interval

2019-07-13 Thread Andrea Claudi
B.W limits can now be specified in %.") Signed-off-by: Andrea Claudi --- tc/tc_util.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tc/tc_util.c b/tc/tc_util.c index 53d15e08e9734..b90d256c33a4a 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@

[PATCH iproute2-next] tunnel: factorize printout of GRE key and flags

2019-07-12 Thread Andrea Claudi
print_tunnel() functions in ip6tunnel.c and iptunnel.c contains the same code to print out GRE key and flags This commit factorize the code in a helper function in tunnel.c Signed-off-by: Andrea Claudi --- ip/ip6tunnel.c | 22 ++ ip/iptunnel.c | 19 ++- ip

Re: [PATCH iproute2 1/2] Revert "ip6tunnel: fix 'ip -6 {show|change} dev ' cmds"

2019-07-10 Thread Andrea Claudi
On Tue, Jul 9, 2019 at 7:31 PM Mahesh Bandewar (महेश बंडेवार) wrote: > > On Tue, Jul 9, 2019 at 6:16 AM Andrea Claudi wrote: > > > > This reverts commit ba126dcad20e6d0e472586541d78bdd1ac4f1123. > > It breaks tunnel creation when using 'dev' parameter: > &g

Re: [PATCH iproute2 2/2] ip tunnel: warn when changing IPv6 tunnel without tunnel name

2019-07-10 Thread Andrea Claudi
On Wed, Jul 10, 2019 at 12:15 AM Mahesh Bandewar (महेश बंडेवार) wrote: > > On Tue, Jul 9, 2019 at 6:16 AM Andrea Claudi wrote: > > > > Tunnel change fails if a tunnel name is not specified while using > > 'ip -6 tunnel change'. However, no warning message i

[PATCH iproute2 2/2] ip tunnel: warn when changing IPv6 tunnel without tunnel name

2019-07-09 Thread Andrea Claudi
change dev dummy0 local 2001:1234::1 remote 2001:1234::2 Tunnel interface name not specified $ ip -6 tunnel show ip6tnl1 ip6tnl1: gre/ipv6 remote fd::2 local fd::1 dev dummy0 encaplimit none hoplimit 127 tclass inherit flowlabel 0x0 (flowinfo 0x) Reviewed-by: Matteo Croce Signed-off-

[PATCH iproute2 0/2] Fix IPv6 tunnel add when dev param is used

2019-07-09 Thread Andrea Claudi
Commit ba126dcad20e6 ("ip6tunnel: fix 'ip -6 {show|change} dev ' cmds") breaks IPv6 tunnel creation when dev parameter is used. This series revert the original commit, which mistakenly use dev for tunnel name, while addressing a issue on tunnel change when no interface name i

[PATCH iproute2 1/2] Revert "ip6tunnel: fix 'ip -6 {show|change} dev ' cmds"

2019-07-09 Thread Andrea Claudi
ip6tnl0" failed: File exists dev parameter must be used to specify the device to which the tunnel is binded, and not the tunnel itself. Reported-by: Jianwen Ji Reviewed-by: Matteo Croce Signed-off-by: Andrea Claudi --- ip/ip6tunnel.c | 2 -- 1 file changed, 2 deletions(-) diff --git a

Re: [PATCH iproute2] ip-route: fix json formatting for metrics

2019-07-08 Thread Andrea Claudi
On Mon, Jul 8, 2019 at 11:38 AM Andrea Claudi wrote: > > Setting metrics for routes currently lead to non-parsable > json output. For example: > > $ ip link add type dummy > $ ip route add 192.168.2.0 dev dummy0 metric 100 mtu 1000 rto_min 3 > $ ip -j route | jq > parse e

[PATCH iproute2] ip-route: fix json formatting for metrics

2019-07-08 Thread Andrea Claudi
"metric": 100, "flags": [], "metrics": [ { "mtu": 1000, "rto_min": 3 } ] } ] Fixes: 663c3cb23103f ("iproute: implement JSON and color output") Fixes: 968272e791710 ("iproute: refactor me

Re: [iproute2] Can't create ip6 tunnel device

2019-07-02 Thread Andrea Claudi
ot; case is not supported at all. However, even if "show" command supports filter (as it seems to do), in my opinion "dev NAME" should be used to filter tunnels based on the device to which they are binded. Mahesh, can you please clarify? Regards, Andrea > On Tue, J

Re: [iproute2] Can't create ip6 tunnel device

2019-07-02 Thread Andrea Claudi
On Tue, Jul 2, 2019 at 12:55 PM Andrea Claudi wrote: > > On Tue, Jul 2, 2019 at 12:27 PM Ji Jianwen wrote: > > > > It seems this issue was introduced by commit below, I am able to run > > the command successfully mentioned at previous mail wi

Re: [iproute2] Can't create ip6 tunnel device

2019-07-02 Thread Andrea Claudi
On Tue, Jul 2, 2019 at 12:27 PM Ji Jianwen wrote: > > It seems this issue was introduced by commit below, I am able to run > the command successfully mentioned at previous mail without it. > > commit ba126dcad20e6d0e472586541d78bdd1ac4f1123 (HEAD) > Author: Mahesh Bandewar > Date: Thu Jun 6 16:

Re: [PATCH iproute2] man: tc-netem.8: fix URL for netem page

2019-07-01 Thread Andrea Claudi
On Mon, Jul 1, 2019 at 4:05 PM Andrea Claudi wrote: > > URL for netem page on sources section points to a no more existent > resource. Fix this using the correct URL. > > Fixes: cd72dcf13c8a4 ("netem: add man-page") > Signed-off-by: Andrea Claudi > --- > ma

[PATCH iproute2] man: tc-netem.8: fix URL for netem page

2019-07-01 Thread Andrea Claudi
URL for netem page on sources section points to a no more existent resource. Fix this using the correct URL. Fixes: cd72dcf13c8a4 ("netem: add man-page") Signed-off-by: Andrea Claudi --- man/man8/tc-netem.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/

[PATCH iproute2-next] utils: move parse_percent() to tc_util

2019-06-28 Thread Andrea Claudi
/1 grow/shrink: 0/0 up/down: 0/-109 (-109) Total: Before=30298, After=30189, chg -0.36% $ bloat-o-meter ip/ip ip/ip.new add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-109 (-109) Total: Before=674164, After=674055, chg -0.02% Signed-off-by: Andrea Claudi --- include/utils.h | 1 - lib/utils.c

[PATCH iproute2] tc: netem: fix r parameter in Bernoulli loss model

2019-06-27 Thread Andrea Claudi
model. Fixes: 3c7950af598be ("netem: add support for 4 state and GE loss model") Signed-off-by: Andrea Claudi --- tc/q_netem.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tc/q_netem.c b/tc/q_netem.c index 6e0e8a8cbfde5..d1cd17f8a8a7e 100644 --- a/tc/q_netem.

[PATCH iproute2 v2 0/3] do not set IPv6-only options on IPv4 addresses

2019-06-25 Thread Andrea Claudi
'home', 'nodad' and 'mngtmpaddr' options are IPv6-only, but it is possible to set them on IPv4 addresses, too. This should not be possible. Fix this adding a check on the protocol family before setting the flags, and print warning messages on error to not break exi

[PATCH iproute2 v2 3/3] ip address: do not set mngtmpaddr option for IPv4 addresses

2019-06-25 Thread Andrea Claudi
ft forever preferred_lft forever Fix this adding a check on the protocol family before setting IFA_F_MANAGETEMPADDR flag. Fixes: 5b7e21c417bea ("add support for IFA_F_MANAGETEMPADDR") Signed-off-by: Andrea Claudi --- ip/ipaddress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion

[PATCH iproute2 v2 2/3] ip address: do not set home option for IPv4 addresses

2019-06-25 Thread Andrea Claudi
amily before setting IFA_F_HOMEADDRESS flag. Fixes: bac735c53a36d ("enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.") Signed-off-by: Andrea Claudi --- ip/ipaddress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ip/ipad

[PATCH iproute2 v2 1/3] ip address: do not set nodad option for IPv4 addresses

2019-06-25 Thread Andrea Claudi
a check on the protocol family before setting IFA_F_NODAD flag. Fixes: bac735c53a36d ("enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.") Signed-off-by: Andrea Claudi --- ip/ipaddress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

Re: [PATCH iproute2 0/3] do not set IPv6-only options on IPv4 addresses

2019-06-24 Thread Andrea Claudi
On Mon, Jun 24, 2019 at 7:21 PM Stephen Hemminger wrote: > > On Mon, 24 Jun 2019 19:05:52 +0200 > Andrea Claudi wrote: > > > 'home', 'nodad' and 'mngtmpaddr' options are IPv6-only, but > > it is possible to set them on IPv4 addresses, too. Th

[PATCH iproute2 3/3] ip address: do not set mngtmpaddr option for IPv4 addresses

2019-06-24 Thread Andrea Claudi
ft forever preferred_lft forever Fix this adding a check on the protocol family before setting IFA_F_MANAGETEMPADDR flag. Fixes: 5b7e21c417bea ("add support for IFA_F_MANAGETEMPADDR") Signed-off-by: Andrea Claudi --- ip/ipaddress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion

[PATCH iproute2 2/3] ip address: do not set home option for IPv4 addresses

2019-06-24 Thread Andrea Claudi
amily before setting IFA_F_HOMEADDRESS flag. Fixes: bac735c53a36d ("enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.") Signed-off-by: Andrea Claudi --- ip/ipaddress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ip/ipad

[PATCH iproute2 0/3] do not set IPv6-only options on IPv4 addresses

2019-06-24 Thread Andrea Claudi
'home', 'nodad' and 'mngtmpaddr' options are IPv6-only, but it is possible to set them on IPv4 addresses, too. This should not be possible. Fix this adding a check on the protocol family before setting the flags, and exiting with invarg() on error. Andrea Claudi

[PATCH iproute2 1/3] ip address: do not set nodad option for IPv4 addresses

2019-06-24 Thread Andrea Claudi
a check on the protocol family before setting IFA_F_NODAD flag. Fixes: bac735c53a36d ("enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.") Signed-off-by: Andrea Claudi --- ip/ipaddress.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

[PATCH iproute2-next v2] Makefile: use make -C to change directory

2019-06-13 Thread Andrea Claudi
estsuite/iproute2/Makefile Signed-off-by: Andrea Claudi --- Makefile| 3 ++- testsuite/Makefile | 6 +++--- testsuite/iproute2/Makefile | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 48f469b0d0a85..a87826fee84dd 1

fh...@kernel.org:qrom 3734f49cbe4b7543f09236d02cbe78b515af1e28 Mon Sep 17 00:00:00 2001

2019-06-13 Thread Andrea Claudi
estsuite/iproute2/Makefile Signed-off-by: Andrea Claudi --- Makefile| 3 ++- testsuite/Makefile | 6 +++--- testsuite/iproute2/Makefile | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 48f469b0d0a85..a87826fee84dd 1

Re: [PATCH iproute2 v2 0/3] refactor the cmd_exec()

2019-06-13 Thread Andrea Claudi
- > lib/utils.c | 27 -- > 8 files changed, 58 insertions(+), 84 deletions(-) > > -- > 2.21.0 > For patch series: Reviewed-and-tested-by: Andrea Claudi

[PATCH iproute2-next] Makefile: use make -C to change directory

2019-06-12 Thread Andrea Claudi
make provides a handy -C option to change directory before reading the makefiles or doing anything else. Use that instead of the "cd dir && make && cd .." pattern, thus simplifying sintax for some makefiles. Signed-off-by: Andrea Claudi --- Makefile

Re: [PATCH iproute2] man: tc-skbedit.8: document 'inheritdsfield'

2019-05-31 Thread Andrea Claudi
> .I PTYPE > is one of: host, otherhost, broadcast, multicast > +.TP > +.BI inheritdsfield > +Override the packet classification decision, and any value specified with > +.BR priority ", " > +using the information stored in the Differentiated Services Field of the > +IPv6/IPv4 header (RFC2474). > .SH SEE ALSO > .BR tc (8), > .BR tc-pedit (8) > -- > 2.20.1 > Acked-by: Andrea Claudi

Re: [PATCH iproute2-next v2] netns: add subcommand to attach an existing network namespace

2019-01-29 Thread Andrea Claudi
".\n", *argv); > exit(-1); > } > diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8 > index d539f18b..39a10e76 100644 > --- a/man/man8/ip-netns.8 > +++ b/man/man8/ip-netns.8 > @@ -19,6 +19,10 @@ ip-netns \- process network namespace management > .B ip netns add > .I NETNSNAME > > +.ti -8 > +.B ip netns attach > +.I NETNSNAME PID > + > .ti -8 > .B ip [-all] netns del > .RI "[ " NETNSNAME " ]" > @@ -89,6 +93,12 @@ This command displays all of the network namespaces in > /var/run/netns > If NAME is available in /var/run/netns/ this command creates a new > network namespace and assigns NAME. > > +.TP > +.B ip netns attach NAME PID - create a new named network namespace > +.sp > +If NAME is available in /var/run/netns/ this command attaches the network > +namespace of the process PID to NAME as if it were created with ip netns. > + > .TP > .B ip [-all] netns delete [ NAME ] - delete the name of a network > namespace(s) > .sp > -- > 2.20.1 > Reviewed-by: Andrea Claudi Tested-by: Andrea Claudi

[PATCH bpf-next] bpf: remove useless variable

2018-12-13 Thread Andrea Claudi
bytes is initialized to end - start at the beginning of this function, and is never changed. Remove it making the code a bit more readable. Suggested-by: Stefano Brivio Signed-off-by: Andrea Claudi --- net/core/filter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH iproute2] l2tp: Fix printing of cookie and peer_cookie values

2018-11-30 Thread Andrea Claudi
print_cookie() invocations miss %s format specifier. While at it, align printout to the previous lines. Fixes: 98453b65800f7 ("ip/l2tp: add JSON support") Signed-off-by: Andrea Claudi --- ip/ipl2tp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ip/ipl

[PATCH v2 net-next] net: lpc_eth: fix trivial comment typo

2018-11-20 Thread Andrea Claudi
Fix comment typo rxfliterctrl -> rxfilterctrl Signed-off-by: Andrea Claudi --- drivers/net/ethernet/nxp/lpc_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index bd8695a4faaa..89d17399f

[PATCH net-next] nxp: fix trivial comment typo

2018-11-14 Thread Andrea Claudi
s/rxfliterctrl/rxfilterctrl Signed-off-by: Andrea Claudi --- drivers/net/ethernet/nxp/lpc_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index bd8695a4faaa..89d17399fb5a 100644 --- a/drivers