Re: [PATCH iproute2-next] ipaddress: fix label matching

2018-07-14 Thread Serhey Popovych
Vincent Bernat wrote: > ❦ 11 juillet 2018 21:01 -0400, David Ahern  : > >>> +++ b/ip/ipaddress.c >>> @@ -837,11 +837,6 @@ int print_linkinfo(const struct sockaddr_nl *who, >>> if (!name) >>> return -1; >>> >>> - if (filter.label && >>> - (!filter.family || filter.family

Re: [PATCH iproute2-next] ipaddress: fix label matching

2018-07-14 Thread Serhey Popovych
Serhey Popovych wrote: > Vincent Bernat wrote: >> ❦ 11 juillet 2018 21:01 -0400, David Ahern  : >> >>>> +++ b/ip/ipaddress.c >>>> @@ -837,11 +837,6 @@ int print_linkinfo(const struct sockaddr_nl *who, >>>>if (!name) >>

[PATCH iproute2] ipaddress: Fix and make consistent label match handling

2018-07-14 Thread Serhey Popovych
Fixes: commit 9516823051ce ("ipaddress: Improve print_linkinfo()") Reported-by: Vincent Bernat Signed-off-by: Serhey Popovych --- ip/ipaddress.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 5009bfe..ea8211c 100644 --

[PATCH iproute2-next v3 2/8] iplink: Correctly report error when network device isn't found

2018-02-22 Thread Serhey Popovych
not found) for this. Signed-off-by: Serhey Popovych --- ip/iplink.c | 16 +--- ip/iplink_xdp.c |7 +-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ip/iplink.c b/ip/iplink.c index 5471626..fc358fc 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -569,6 +569,1

[PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse()

2018-02-22 Thread Serhey Popovych
off-by: Serhey Popovych --- ip/ip_common.h | 16 +--- ip/iplink.c | 34 ++ ip/iplink_bond.c |4 +++- ip/iplink_bond_slave.c |4 +++- ip/iplink_bridge.c |4 +++- ip/iplink_bridge_slave.c |4 +++-

[PATCH iproute2-next v3 7/8] iplink: Move data structures to block of their users

2018-02-22 Thread Serhey Popovych
This will consolidate data and code using it in single place and prepare for upcoming ->parse_opt() method change. Signed-off-by: Serhey Popovych --- ip/link_gre.c| 32 ip/link_gre6.c | 32 ip/link_ip6tnl.c |

[PATCH iproute2-next v3 4/8] iplink: Follow documented behaviour when "index" is given

2018-02-22 Thread Serhey Popovych
ed for ip link delete scenario (actually "index" being ignored in favor to "dev"). Prohibit "index" when configuring/deleting group of network devices. Signed-off-by: Serhey Popovych --- ip/iplink.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) d

[PATCH iproute2-next v3 0/8] iplink: Improve iplink_parse()

2018-02-22 Thread Serhey Popovych
a exit() when failing to parse command line arguments to help identify failing line in batch mode. Thanks, Serhii Serhey Popovych (8): utils: Introduce and use nodev() helper routine iplink: Correctly report error when network device isn't found iplink: Use "dev" and "

[PATCH iproute2-next v3 6/8] iplink: Perform most of request buffer setups and checks in iplink_parse()

2018-02-22 Thread Serhey Popovych
needed outside. While there change return -1 to exit(-1) for group parsing errors: we want to stop further command processing unless -force option is given to get error line easily. Signed-off-by: Serhey Popovych --- ip/ip_common.h|3 +- ip/iplink.c | 118

[PATCH iproute2-next v3 5/8] veth,vxcan: Save/reinitialize/restore whole @struct ifinfomsg

2018-02-22 Thread Serhey Popovych
in device ifinfomsg data. Since @struct ifinfomsg is small enough with known sizeof() compiler may inline memcpy()/memset() with few load/store instructions. Signed-off-by: Serhey Popovych --- ip/iplink_vxcan.c | 22 -- ip/link_veth.c| 22 -- 2 files ch

[PATCH iproute2-next v3 3/8] iplink: Use "dev" and "name" parameters interchangeable when possible

2018-02-22 Thread Serhey Popovych
behaviour on link create: ip link add {name|dev} veth1a type veth peer {name|dev} veth1b Signed-off-by: Serhey Popovych --- ip/iplink.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/ip/iplink.c b/ip/iplink.c index fc358fc..135

[PATCH iproute2-next v3 1/8] utils: Introduce and use nodev() helper routine

2018-02-22 Thread Serhey Popovych
and returns -1 to it's caller. Either call exit() or return to the caller to preserve behaviour before change. Use -nodev() in traffic control (tc) code to return 1. Simplify expression for checking for argument being 0/NULL in @if statement. Signed-off-by: Serhey Popovych --- bridge/

Re: [PATCH iproute2-next v3 2/8] iplink: Correctly report error when network device isn't found

2018-02-25 Thread Serhey Popovych
David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> @@ -650,6 +658,9 @@ int iplink_parse(int argc, char **argv, struct >> iplink_req *req, >> bool drv = strcmp(*argv, "xdpdrv") == 0; >> bool offlo

Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse()

2018-02-26 Thread Serhey Popovych
David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> Introduce new @struct iplink_parse_args data structure to consolidate >> arguments to iplink_parse(). This will reduce number of arguments >> passed to it. >> >> Pass this data structure to ->pa

Re: [PATCH iproute2-next v3 5/8] veth,vxcan: Save/reinitialize/restore whole @struct ifinfomsg

2018-02-26 Thread Serhey Popovych
David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> Now in iplink_parse() we use ->ifi_change and ->ifi_flags fields and >> plan to use ->ifi_index with upcoming change. >> >> Saving, restoring and reinitializing individual fields is error prone

Re: [PATCH iproute2-next v3 6/8] iplink: Perform most of request buffer setups and checks in iplink_parse()

2018-02-26 Thread Serhey Popovych
David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> To benefit other users (e.g. link_veth.c) of iplink_parse() from >> additional attribute checks and setups made in iplink_modify(). This >> catches most of weired cobination of parameters to peer device >>

Re: [PATCH iproute2-next v3 5/8] veth,vxcan: Save/reinitialize/restore whole @struct ifinfomsg

2018-02-26 Thread Serhey Popovych
David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> Now in iplink_parse() we use ->ifi_change and ->ifi_flags fields and >> plan to use ->ifi_index with upcoming change. >> >> Saving, restoring and reinitializing individual fields is error prone

Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse()

2018-02-26 Thread Serhey Popovych
David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> Introduce new @struct iplink_parse_args data structure to consolidate >> arguments to iplink_parse(). This will reduce number of arguments >> passed to it. >> >> Pass this data structure to ->pa

Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse()

2018-02-26 Thread Serhey Popovych
Stephen Hemminger wrote: > On Thu, 22 Feb 2018 15:02:06 +0200 > Serhey Popovych wrote: > >> +struct iplink_parse_args { >> +const char *dev; >> +const char *name; >> +const char *type; >> + >> +/* This definitely must be the last on

Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse()

2018-02-26 Thread Serhey Popovych
David Ahern wrote: > On 2/26/18 11:20 AM, Serhey Popovych wrote: >> Stephen Hemminger wrote: >>> On Thu, 22 Feb 2018 15:02:06 +0200 >>> Serhey Popovych wrote: >>> >>>> +struct iplink_parse_args { >>>> + const char *dev; >>>&g

Re: [PATCH iproute2] Fix compilation with kernel headers < 3.4

2018-02-26 Thread Serhey Popovych
Thomas De Schampheleire wrote: > Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types > __kernel_long_t and __kernel_ulong_t but does not provide internal > definitions for it. I tried one time to build with headers from 3.2 (last supported LTS at the moment) and found that A

[PATCH iproute2] Fix compilation with kernel headers < 3.4

2018-02-26 Thread Serhey Popovych
Signed-off-by: Serhey Popovych --- include/linux/sysinfo.h | 14 ++ misc/ss.c | 10 ++ 2 files changed, 24 insertions(+) create mode 100644 include/linux/sysinfo.h diff --git a/include/linux/sysinfo.h b/include/linux/sysinfo.h new file mode 100644 index

Re: [PATCH iproute2] Fix compilation with kernel headers < 3.4

2018-02-26 Thread Serhey Popovych
Serhey Popovych wrote: > Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types > __kernel_long_t and __kernel_ulong_t but does not provide internal > definitions for it. > > This means that compilation using kernel headers that are older than 3.4 > (wher

Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse()

2018-02-26 Thread Serhey Popovych
Serhey Popovych wrote: > David Ahern wrote: >> On 2/26/18 11:20 AM, Serhey Popovych wrote: >>> Stephen Hemminger wrote: >>>> On Thu, 22 Feb 2018 15:02:06 +0200 >>>> Serhey Popovych wrote: >>>> >>>>> +struct iplink_parse_args {

Re: [PATCH iproute2] Fix compilation with kernel headers < 3.4

2018-02-26 Thread Serhey Popovych
Thomas De Schampheleire wrote: > On Mon, Feb 26, 2018 at 09:46:41PM +0200, Serhey Popovych wrote: >> Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types >> __kernel_long_t and __kernel_ulong_t but does not provide internal >> definitions for it.

[PATCH iproute2 2/3] ss: Fix build with old libc headers without AF_VSOCK

2018-02-27 Thread Serhey Popovych
ompatibility; adjust AF_MAX and PF_MAX to reflect change. Tested in Debian 7 (Wheezy) environment with glibc-2.13 and Linux Kernel 3.2. Still supported config until 31 May 2018 according to Debian LTS support page. Signed-off-by: Serhey Popovych --- include/compat/libc/bits/socket.h | 15 +++

[PATCH iproute2 1/3] ip: Fix compilation with kernel headers < 3.4

2018-02-27 Thread Serhey Popovych
Thomas De Schampheleire Signed-off-by: Serhey Popovych --- Makefile |5 - include/compat/kernel/linux/sysinfo.h | 14 ++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 include/compat/kernel/linux/sysinfo.h diff --git a/

[PATCH iproute2 3/3] ip: Get rid of custom netinet/tcp.h

2018-02-27 Thread Serhey Popovych
eport ecnseen") and original one introducing this include commit 76e5d2c39201 ("add include/netinet/tcp.h"). Any missing functionality and compatibility stuff must go to "compat" subdirectory in include/. Signed-off-by: Serhey Popovych ---

[PATCH iproute2 0/3] ip: Provide compatibility bits to build with old glibc/kernel headers

2018-02-27 Thread Serhey Popovych
x27;s contents for compat. As usal reviews, comments and suggestions are welcome. Thanks, Serhii Serhey Popovych (3): ip: Fix compilation with kernel headers < 3.4 ss: Fix build with old libc headers without AF_VSOCK ip: Get rid of custom netinet/tcp.h Makefile

Re: [PATCH iproute2] Fix compilation with kernel headers < 3.4

2018-02-27 Thread Serhey Popovych
Thomas De Schampheleire wrote: > On Mon, Feb 26, 2018 at 09:46:41PM +0200, Serhey Popovych wrote: >> Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types >> __kernel_long_t and __kernel_ulong_t but does not provide internal >> definitions for it.

Re: [PATCH iproute2 1/3] ip: Fix compilation with kernel headers < 3.4

2018-02-27 Thread Serhey Popovych
Stephen Hemminger wrote: > On Tue, 27 Feb 2018 14:06:50 +0200 > Serhey Popovych wrote: > >> Since commit 596b1c94aa38 ("iproute: build more easily on Android"), >> iproute2 uses types __kernel_long_t and __kernel_ulong_t but does not >> provide internal defi

Re: [PATCH iproute2 1/3] ip: Fix compilation with kernel headers < 3.4

2018-03-01 Thread Serhey Popovych
Stephen Hemminger wrote: > On Tue, 27 Feb 2018 21:34:56 +0200 > Serhey Popovych wrote: > >> Stephen Hemminger wrote: >>> On Tue, 27 Feb 2018 14:06:50 +0200 >>> Serhey Popovych wrote: >>> >>>> Since commit 596b1c94aa38 ("iprout

Re: [PATCH iproute2 2/3] ss: Fix build with old libc headers without AF_VSOCK

2018-03-01 Thread Serhey Popovych
Stephen Hemminger wrote: > On Tue, 27 Feb 2018 14:06:51 +0200 > Serhey Popovych wrote: > >> diff --git a/include/compat/libc/bits/socket.h >> b/include/compat/libc/bits/socket.h >> new file mode 100644 >> index 000..25ef0d5 >> --- /dev/null >

[PATCH iproute2-next v4 3/4] iplink: Follow documented behaviour when "index" is given

2018-03-07 Thread Serhey Popovych
ed for ip link delete scenario (actually "index" being ignored in favor to "dev"). Prohibit "index" when configuring/deleting group of network devices. Signed-off-by: Serhey Popovych --- ip/iplink.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) d

[PATCH iproute2-next v4 4/4] iplink: Perform most of request buffer setups and checks in iplink_parse()

2018-03-07 Thread Serhey Popovych
are not needed outside. While there change return -1 to exit(-1) for group parsing errors: we want to stop further command processing unless -force option is given to get error line easily. Signed-off-by: Serhey Popovych --- ip/ip_common.h|4 +- ip/iplink.c | 143

[PATCH iproute2-next v4 2/4] iplink: Use "dev" and "name" parameters interchangeable when possible

2018-03-07 Thread Serhey Popovych
behaviour on link create: ip link add {name|dev} veth1a type veth peer {name|dev} veth1b Signed-off-by: Serhey Popovych --- ip/iplink.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/ip/iplink.c b/ip/iplink.c index 5471626..b43

[PATCH iproute2-next v4 0/4] iplink: Improve iplink_parse()

2018-03-07 Thread Serhey Popovych
ments to help identify failing line in batch mode. Thanks, Serhii Serhey Popovych (4): utils: Introduce and use nodev() helper routine iplink: Use "dev" and "name" parameters interchangeable when possible iplink: Follow documented behaviour when "index" is

[PATCH iproute2-next v4 1/4] utils: Introduce and use nodev() helper routine

2018-03-07 Thread Serhey Popovych
and returns -1 to it's caller. Either call exit() or return to the caller to preserve behaviour before change. Use -nodev() in traffic control (tc) code to return 1. Simplify expression for checking for argument being 0/NULL in @if statement. Signed-off-by: Serhey Popovych --- bridge/

[PATCH iproute2 2/3] iplink: Process "alias" parameter correctly

2017-12-18 Thread Serhey Popovych
Do not stop parameters processing after "alias" parameter: it might not be a last one. Seems copy pasted from "type" parameter code. Check it's length does not exceed IFALIASZ - 1. Better we warn than get RTNL error. Signed-off-by: Serhey Popovych --- ip/iplink.c |

[PATCH iproute2 0/3] Improve iplink index, alias and name parameters handling

2017-12-18 Thread Serhey Popovych
does not exceed IFALIASZ - 1. 3) Drop redundant name parameter length checks in iplink_vxcan.c and link_veth.c. See individual patch description message for details. Thanks, Serhii Serhey Popovych (3): iplink: Improve index parameter handling iplink: Process "alias"

[PATCH iproute2 1/3] iplink: Improve index parameter handling

2017-12-18 Thread Serhey Popovych
No need to initialize ifi_index with 0 since it is already initialized at the @struct req initialization time and not modified in iplink_parse(). Signed-off-by: Serhey Popovych --- ip/iplink.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ip/iplink.c b/ip/ipli

[PATCH iproute2 3/3] iplink: Kill redundant network device name checks

2017-12-18 Thread Serhey Popovych
Since commit 625df645b703 (Check user supplied interface name lengths) iplink_parse() validates network device name using check_ifname() helpers. Remove redundant "name" length checks from iplink_parse() callers. Signed-off-by: Serhey Popovych --- ip/iplink_vxcan.c |8 ++

[PATCH net-next] dev: Correctly get length of alias string in dev_set_alias()

2017-12-18 Thread Serhey Popovych
putting '\0' not at @len - 1. Use strnlen() to get length of zero terminated string and not access beyond @len. Correct comment about @len and explain how to unset alias (i.e. use zero for @len). Signed-off-by: Serhey Popovych --- net/core/dev.c | 4 +++- 1 file changed, 3 insert

[PATCH iproute2 3/3] utils: ll_map: Make network device name fixed size array of char

2017-12-19 Thread Serhey Popovych
/store instructions on 64/32 bit systems. Check if IFLA_IFNAME attribute present in netlink message (should always) and use strncpy() to pad name with zeros. Signed-off-by: Serhey Popovych --- lib/ll_map.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a

[PATCH iproute2 0/3] Forbid "type" for peer, update ifname and make it array in ll_cache

2017-12-19 Thread Serhey Popovych
benefit from compiler call inlining. See individual patch description message for details. Thanks, Serhii Serhey Popovych (3): vxcan,veth: Forbid "type" for peer device utils: ll_map: Update name and type for existing entry utils: ll_map: Make network device name fixed size

[PATCH iproute2 1/3] vxcan,veth: Forbid "type" for peer device

2017-12-19 Thread Serhey Popovych
: argument "type" is wrong: not supported for peer Signed-off-by: Serhey Popovych --- ip/iplink_vxcan.c |3 +++ ip/link_veth.c|3 +++ 2 files changed, 6 insertions(+) diff --git a/ip/iplink_vxcan.c b/ip/iplink_vxcan.c index c13224c..13f2577 100644 --- a/ip/iplink_vxcan.

[PATCH iproute2 2/3] utils: ll_map: Update name and type for existing entry

2017-12-19 Thread Serhey Popovych
duplications. Signed-off-by: Serhey Popovych --- lib/ll_map.c | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/ll_map.c b/lib/ll_map.c index f65614f..abe7bdc 100644 --- a/lib/ll_map.c +++ b/lib/ll_map.c @@ -10,6 +10,7 @@ * */ +#include

[PATCH iproute2 0/2] ip/tunnel: Do not free() answer on rtnl_talk() error, correct ip6gre

2017-12-19 Thread Serhey Popovych
ll_addr_n2a(): endpoints are IPv6 addresses, not hex dump. See individual patch description message for details. Thanks, Serhii Serhey Popovych (2): utils: ll_addr: Handle ARPHRD_IP6GRE in ll_addr_n2a() ip/tunnel: No need to free answer after rtnl_talk() on error ip/link_gre.c|3

[PATCH iproute2 2/2] ip/tunnel: No need to free answer after rtnl_talk() on error

2017-12-19 Thread Serhey Popovych
Since rtnl_talk() never returns with answer buffer allocated on error we do not need to release it manually. After this initializing answer with NULL before rtnl_talk() is useless. Signed-off-by: Serhey Popovych --- ip/link_gre.c|3 +-- ip/link_gre6.c |3 +-- ip/link_ip6tnl.c

[PATCH iproute2 1/2] utils: ll_addr: Handle ARPHRD_IP6GRE in ll_addr_n2a()

2017-12-19 Thread Serhey Popovych
default link/tunnel6 :: brd :: 19: ip6gre0: mtu 1456 qdisc noop state DOWN mode DEFAULT group default link/gre6 :: brd :: Signed-off-by: Serhey Popovych --- lib/ll_addr.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ll_addr.c b/lib/ll_addr.c index c03523d

[PATCH iproute2 0/3] ip/tunnel: Fix noencap- and document "external" parameter handling.

2017-12-27 Thread Serhey Popovych
for details. Thanks, Serhii Serhey Popovych (3): gre,ip6tnl/tunnel: Fix noencap- support gre6/tunnel: Do not submit garbage in flowinfo ip/tunnel: Document "external" parameter ip/link_gre.c |7 +-- ip/link_gre6.c|4 ++-- ip/link_ip6tnl.c

[PATCH iproute2 3/3] ip/tunnel: Document "external" parameter

2017-12-27 Thread Serhey Popovych
Also add "noexternal" variant to be inline with geneve and vxlan tunnel types. Signed-off-by: Serhey Popovych --- ip/link_gre.c |3 +++ ip/link_ip6tnl.c |4 +++- ip/link_iptnl.c |4 +++- man/man8/ip-link.8.in |6 ++ 4 files changed, 15 insert

[PATCH iproute2 1/3] gre,ip6tnl/tunnel: Fix noencap- support

2017-12-27 Thread Serhey Popovych
We must clear bit, not set all but given bit. Fixes: 858dbb208e39 ("ip link: Add support for remote checksum offload to IP tunnels") Fixes: 73516e128a5a ("ip6tnl: Support for fou encapsulation" Signed-off-by: Serhey Popovych --- ip/link_gre.c|4 ++-- ip/link_ip6tnl.

[PATCH iproute2 2/3] gre6/tunnel: Do not submit garbage in flowinfo

2017-12-27 Thread Serhey Popovych
IP6_TNL_F_USE_ORIG_FLOWLABEL when printing options sending invalid flowlabel/tclass to the kernel seems bad idea. Note that ip6tnl always clean corresponding flowinfo parts on inherit. Signed-off-by: Serhey Popovych --- ip/link_gre6.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip

Re: [PATCH iproute2 0/3] ip/tunnel: Fix noencap- and document "external" parameter handling.

2017-12-27 Thread Serhey Popovych
Stephen Hemminger wrote: > On Wed, 27 Dec 2017 13:28:13 +0200 > Serhey Popovych wrote: > >> In this series I present next set of improvements/fixes: >> >> 1) Fix noencap- option handling: we need to clear bit, instead >> of seting all, but one we exp

Re: [PATCH iproute2 1/3] vxcan,veth: Forbid "type" for peer device

2017-12-28 Thread Serhey Popovych
Stephen Hemminger wrote: > On Wed, 20 Dec 2017 09:37:29 +0200 > Serhey Popovych wrote: > >> It is already given for original device we configure this >> peer for. >> >> Results from following command before/after change applied >> are shown below: >

[PATCH iproute2 1/3] vxcan,veth: Forbid "type" for peer device

2017-12-28 Thread Serhey Popovych
: duplicate "type": "veth" is the second value. Signed-off-by: Serhey Popovych --- ip/iplink_vxcan.c |3 +++ ip/link_veth.c|3 +++ 2 files changed, 6 insertions(+) diff --git a/ip/iplink_vxcan.c b/ip/iplink_vxcan.c index c13224c..ed0ad8b 100644 --- a/ip/ipl

[PATCH iproute2 3/3] ip/tunnel: Document "external" parameter

2017-12-28 Thread Serhey Popovych
Add it to ip-link(8) "type gre" output help message as well as to ip-link(8) page. Signed-off-by: Serhey Popovych --- ip/link_gre.c |1 + man/man8/ip-link.8.in |7 +++ 2 files changed, 8 insertions(+) diff --git a/ip/link_gre.c b/ip/link_gre.c index 896bb19..3c0b

[PATCH iproute2] gre/tunnel: Print erspan_index using print_uint()

2017-12-28 Thread Serhey Popovych
One is missing in JSON output because fprintf() is used instead of print_uint(). Signed-off-by: Serhey Popovych --- ip/link_gre.c |3 ++- ip/link_gre6.c |4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ip/link_gre.c b/ip/link_gre.c index 896bb19..1e331c8 100644

Re: [PATCH iproute2] gre/tunnel: Print erspan_index using print_uint()

2017-12-28 Thread Serhey Popovych
contains refactoring, optimization and cleanups, not fixes. Sorry again and thanks for feedback. > > On Thu, Dec 28, 2017 at 3:12 AM, Serhey Popovych > wrote: >> One is missing in JSON output because fprintf() >> is used instead of print_uint(). >> >> Sign

Re: [PATCH iproute2 3/3] utils: ll_map: Make network device name fixed size array of char

2017-12-28 Thread Serhey Popovych
Stephen Hemminger wrote: > On Wed, 20 Dec 2017 09:37:31 +0200 > Serhey Popovych wrote: > >> Network device names are fixed in size and never exceed >> IFNAMSIZ (16 bytes). >> >> Make name fixed size array to always malloc() same size chunk >> of memory

Re: [PATCH iproute2 2/3] utils: ll_map: Update name and type for existing entry

2017-12-28 Thread Serhey Popovych
Stephen Hemminger wrote: > On Wed, 20 Dec 2017 09:37:30 +0200 > Serhey Popovych wrote: > >> In case of we update existing entry we need not only rehash >> but also update name in existing entry. >> >> Need to update device type too since cached interface migh

[PATCH iproute2 1/3] link_iptnl: Kill code duplication

2018-01-02 Thread Serhey Popovych
Both sit and ipip "mode" parameter handling nearly the same. Except for sit we have "ip6ip" mode: check it only when configuring sit. Note that there is no need strcmp(lu->id, "ipip"): if it is not sit it is "ipip" because we have only these two link uti

[PATCH iproute2 0/3] iptnl/tunnel: Open JSON section, kill code duplication and print iptnl mode

2018-01-02 Thread Serhey Popovych
mode to be inline with ip6tnl. See individual patch description message for details. Thanks, Serhii Serhey Popovych (3): link_iptnl: Kill code duplication link_iptnl: Print tunnel mode link_iptnl: Open "encap" JSON object ip/link_iptnl.c | 45 +++--

[PATCH iproute2 2/3] link_iptnl: Print tunnel mode

2018-01-02 Thread Serhey Popovych
Tunnel mode does not appear in parameters print for iptnl supported tunnels like ipip and sit, while printed for ip6tnl. Print tunnel mode with "proto" field for JSON and without any name when printing to cli to follow ip6tnl behaviour. Signed-off-by: Serhey Popovych --- ip/link_iptn

[PATCH iproute2 3/3] link_iptnl: Open "encap" JSON object

2018-01-02 Thread Serhey Popovych
It seems missing pair of open_json_object()/close_json_object() in iptnl implementation. Note that we open "encap" JSON object in ip6tnl. Signed-off-by: Serhey Popovych --- ip/link_iptnl.c |1 + 1 file changed, 1 insertion(+) diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c ind

[PATCH iproute2 v2 2/3] link_iptnl: Print tunnel mode

2018-01-02 Thread Serhey Popovych
any remote any local X.X.X.X ... ^^^ Signed-off-by: Serhey Popovych --- v2: Addressed comments: "proto ipip" vs "proto ip4ip4" for IPPROTO_IPIP tunnel type. Add example to message. ip/link_iptnl.c | 17 + 1 file changed, 17 insertions(+) dif

[PATCH iproute2 v2 0/3] iptnl/tunnel: Open JSON section, kill code duplication and print iptnl mode

2018-01-02 Thread Serhey Popovych
mode to be inline with ip6tnl. See individual patch description message for details. This is v2. Fixed proto value for ipip tunnel mode: "proto ipip" vs "proto ip4ip4" previously. Thanks, Serhii Serhey Popovych (3): link_iptnl: Kill code duplication link_iptnl: Print tunnel

[PATCH iproute2 v2 3/3] link_iptnl: Open "encap" JSON object

2018-01-02 Thread Serhey Popovych
It seems missing pair of open_json_object()/close_json_object() in iptnl implementation. Note that we open "encap" JSON object in ip6tnl. Signed-off-by: Serhey Popovych --- ip/link_iptnl.c |1 + 1 file changed, 1 insertion(+) diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c ind

[PATCH iproute2 v2 2/3] link_iptnl: Print tunnel mode

2018-01-02 Thread Serhey Popovych
any remote any local X.X.X.X ... ^^^ Signed-off-by: Serhey Popovych --- ip/link_iptnl.c | 17 + 1 file changed, 17 insertions(+) diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c index d4d935b..b6ef95d 100644 --- a/ip/link_iptnl.c +++ b/ip/link_iptnl.c @@ -372,6 +372,23

[PATCH iproute2 v2 1/3] link_iptnl: Kill code duplication

2018-01-02 Thread Serhey Popovych
Both sit and ipip "mode" parameter handling nearly the same. Except for sit we have "ip6ip" mode: check it only when configuring sit. Note that there is no need strcmp(lu->id, "ipip"): if it is not sit it is "ipip" because we have only these two link uti

Re: [PATCH iproute2 v2 2/3] link_iptnl: Print tunnel mode

2018-01-02 Thread Serhey Popovych
Stephen Hemminger wrote: > On Tue, 2 Jan 2018 23:02:45 +0200 > Serhey Popovych wrote: > >> Tunnel mode does not appear in parameters print for iptnl >> supported tunnels like ipip and sit, while printed for >> ip6tnl. >> >> Print tunnel mode as "p

[PATCH iproute2 v3 3/7] ip6/tunnel: Unify tclass printing

2018-01-08 Thread Serhey Popovych
check for IFLA_GRE_FLOWINFO attribute presense. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 16 +--- ip/link_ip6tnl.c | 16 +--- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 87c313c..a02dd4a 100644

[PATCH iproute2 v3 1/7] ip6/tunnel: Fix tclass output

2018-01-08 Thread Serhey Popovych
s: 1facc1c61c07 ("ip: link_ip6tnl.c: add json output support") Fixes: 2e706e12d9b0 ("Merge branch 'master' into net-next") Signed-off-by: Serhey Popovych --- ip/link_gre6.c |2 +- ip/link_ip6tnl.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --g

[PATCH iproute2 v3 5/7] ip6/tunnel: Unify encap_limit printing

2018-01-08 Thread Serhey Popovych
Use %u format specifier to print it in link_gre6.c and make code more readable. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 11 --- ip/link_ip6tnl.c | 12 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index

[PATCH iproute2 v3 6/7] gre6/tunnel: Output flowlabel after tclass

2018-01-08 Thread Serhey Popovych
To follow ip6tnl output print flowlabel after tclass in link_gre6.c. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 8014207..55bd1fb 100644 --- a/ip

[PATCH iproute2 v3 2/7] ip6tnl/tunnel: Do not print obscure flowinfo

2018-01-08 Thread Serhey Popovych
It is implementation internal and main purpose of printing it seems debugging. Signed-off-by: Serhey Popovych --- ip/link_ip6tnl.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c index 8e84ed0..e084975 100644 --- a/ip/link_ip6tnl.c +++ b/ip

[PATCH iproute2 v3 0/7] ip6/tunnel: Unify tclass, flowlabel and encap_limit output

2018-01-08 Thread Serhey Popovych
With this series I want to improve printing of tclass, flowlabel and encapsulation limit (encap_limit) options. Everything within this series is open for your comments, suggestions and criticism. See individual patch description message for details. Thanks, Serhii Serhey Popovych (7): ip6

[PATCH iproute2 v3 4/7] ip6/tunnel: Unify flowlabel printing

2018-01-08 Thread Serhey Popovych
attribute is given and IP6_TNL_F_USE_ORIG_FLOWLABEL isn't set. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 15 --- ip/link_ip6tnl.c | 14 -- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index a02dd4a..1205946 1

[PATCH iproute2 0/7] ip6/tunnel: Unify tclass, flowlabel and encap_limit output

2018-01-08 Thread Serhey Popovych
With this series I want to improve printing of tclass, flowlabel and encapsulation limit (encap_limit) options. Everything within this series is open for your comments, suggestions and criticism. See individual patch description message for details. Thanks, Serhii Serhey Popovych (7): ip6

[PATCH iproute2 1/7] ip6/tunnel: Fix tclass output

2018-01-08 Thread Serhey Popovych
s: 1facc1c61c07 ("ip: link_ip6tnl.c: add json output support") Fixes: 2e706e12d9b0 ("Merge branch 'master' into net-next") Signed-off-by: Serhey Popovych --- ip/link_gre6.c |2 +- ip/link_ip6tnl.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --g

[PATCH iproute2 4/7] ip6/tunnel: Unify flowlabel printing

2018-01-08 Thread Serhey Popovych
attribute is given and IP6_TNL_F_USE_ORIG_FLOWLABEL isn't set. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 15 --- ip/link_ip6tnl.c | 14 -- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index a02dd4a..1205946 1

[PATCH iproute2 5/7] ip6/tunnel: Unify encap_limit printing

2018-01-08 Thread Serhey Popovych
Use %u format specifier to print it in link_gre6.c and make code more readable. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 11 --- ip/link_ip6tnl.c | 12 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index

[PATCH iproute2 3/7] ip6/tunnel: Unify tclass printing

2018-01-08 Thread Serhey Popovych
check for IFLA_GRE_FLOWINFO attribute presense. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 16 +--- ip/link_ip6tnl.c | 16 +--- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 87c313c..a02dd4a 100644

[PATCH iproute2 7/7] ip6tnl/tunnel: Output hoplimit before encapsulation limit

2018-01-08 Thread Serhey Popovych
To follow gre6 output print hoplimit before encapsulation limit in link_ip6tnl.c. Signed-off-by: Serhey Popovych --- ip/link_ip6tnl.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c index 379eb33..bbc7878 100644 --- a/ip

[PATCH iproute2 6/7] gre6/tunnel: Output flowlabel after tclass

2018-01-08 Thread Serhey Popovych
To follow ip6tnl output print flowlabel after tclass in link_gre6.c. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 8014207..55bd1fb 100644 --- a/ip

Re: [PATCH iproute2 v3 0/7] ip6/tunnel: Unify tclass, flowlabel and encap_limit output

2018-01-08 Thread Serhey Popovych
> See individual patch description message for details. > > Thanks, > Serhii > > Serhey Popovych (7): > ip6/tunnel: Fix tclass output > ip6tnl/tunnel: Do not print obscure flowinfo > ip6/tunnel: Unify tclass printing > ip6/tunnel: Unify flowlabel printing >

[PATCH iproute2 2/7] ip6tnl/tunnel: Do not print obscure flowinfo

2018-01-08 Thread Serhey Popovych
It is implementation internal and main purpose of printing it seems debugging. Signed-off-by: Serhey Popovych --- ip/link_ip6tnl.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c index 8e84ed0..e084975 100644 --- a/ip/link_ip6tnl.c +++ b/ip

[PATCH iproute2 v4 3/7] ip6/tunnel: Unify tclass printing

2018-01-10 Thread Serhey Popovych
check for IFLA_GRE_FLOWINFO attribute presense. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 16 +--- ip/link_ip6tnl.c | 16 +--- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 87c313c..a02dd4a 100644

[PATCH iproute2 v4 5/7] ip6/tunnel: Unify encap_limit printing

2018-01-10 Thread Serhey Popovych
Use %u format specifier to print it in link_gre6.c and make code more readable. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 11 --- ip/link_ip6tnl.c | 12 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index

[PATCH iproute2 v4 7/7] ip6tnl/tunnel: Output hoplimit before encapsulation limit

2018-01-10 Thread Serhey Popovych
To follow gre6 output print hoplimit before encapsulation limit in link_ip6tnl.c. Signed-off-by: Serhey Popovych --- ip/link_ip6tnl.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c index 379eb33..bbc7878 100644 --- a/ip

[PATCH iproute2 v4 6/7] gre6/tunnel: Output flowlabel after tclass

2018-01-10 Thread Serhey Popovych
To follow ip6tnl output print flowlabel after tclass in link_gre6.c. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 8014207..55bd1fb 100644 --- a/ip

[PATCH iproute2 v4 0/7] iptnl/tunnel: Open JSON section, kill code duplication and print iptnl mode

2018-01-10 Thread Serhey Popovych
mode to be inline with ip6tnl. See individual patch description message for details. This is v2. Fixed proto value for ipip tunnel mode: "proto ipip" vs "proto ip4ip4" previously. v4 rebased to current upstream v1..v3 no changes. initially started with v3 instead of v1 Than

[PATCH iproute2 v4 4/7] ip6/tunnel: Unify flowlabel printing

2018-01-10 Thread Serhey Popovych
attribute is given and IP6_TNL_F_USE_ORIG_FLOWLABEL isn't set. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 15 --- ip/link_ip6tnl.c | 14 -- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index a02dd4a..1205946 1

[PATCH iproute2 v4 2/7] ip6tnl/tunnel: Do not print obscure flowinfo

2018-01-10 Thread Serhey Popovych
It is implementation internal and main purpose of printing it seems debugging. Signed-off-by: Serhey Popovych --- ip/link_ip6tnl.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c index 8e84ed0..e084975 100644 --- a/ip/link_ip6tnl.c +++ b/ip

[PATCH iproute2 v4 1/7] ip6/tunnel: Fix tclass output

2018-01-10 Thread Serhey Popovych
s: 1facc1c61c07 ("ip: link_ip6tnl.c: add json output support") Fixes: 2e706e12d9b0 ("Merge branch 'master' into net-next") Signed-off-by: Serhey Popovych --- ip/link_gre6.c |2 +- ip/link_ip6tnl.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --g

Re: [PATCH iproute2 0/7] ip6/tunnel: Unify tclass, flowlabel and encap_limit output

2018-01-10 Thread Serhey Popovych
Stephen Hemminger wrote: > On Mon, 8 Jan 2018 19:06:31 +0200 > Serhey Popovych wrote: > >> With this series I want to improve printing of tclass, >> flowlabel and encapsulation limit (encap_limit) options. >> >> Everything within this series is open for

[PATCH iproute2 v5 1/7] ip6/tunnel: Fix tclass output

2018-01-10 Thread Serhey Popovych
s: 1facc1c61c07 ("ip: link_ip6tnl.c: add json output support") Fixes: 2e706e12d9b0 ("Merge branch 'master' into net-next") Signed-off-by: Serhey Popovych --- ip/link_gre6.c |2 +- ip/link_ip6tnl.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --g

[PATCH iproute2 v5 6/7] gre6/tunnel: Output flowlabel after tclass

2018-01-10 Thread Serhey Popovych
To follow ip6tnl output print flowlabel after tclass in link_gre6.c. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index 8014207..55bd1fb 100644 --- a/ip

[PATCH iproute2 v5 5/7] ip6/tunnel: Unify encap_limit printing

2018-01-10 Thread Serhey Popovych
Use %u format specifier to print it in link_gre6.c and make code more readable. Signed-off-by: Serhey Popovych --- ip/link_gre6.c | 11 --- ip/link_ip6tnl.c | 12 ++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ip/link_gre6.c b/ip/link_gre6.c index

  1   2   3   4   >