Re: [PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups

2018-02-06 Thread Serhey Popovych
David Ahern wrote: > On 2/6/18 7:16 PM, David Ahern wrote: >> On 2/2/18 6:10 AM, Serhey Popovych wrote: >>> @@ -414,15 +428,18 @@ static int do_tunnels_list(struct ip_tunnel_parm *p) >>> fprintf(stderr, "Failed to get type of \"%s\"\n", name); >>> continue; >

Re: [PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups

2018-02-06 Thread Serhey Popovych
David Ahern wrote: > On 2/2/18 6:10 AM, Serhey Popovych wrote: >> @@ -414,15 +428,18 @@ static int do_tunnels_list(struct ip_tunnel_parm *p) >> fprintf(stderr, "Failed to get type of \"%s\"\n", name); >> continue; >> } >> -if (type

Re: [PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups

2018-02-06 Thread David Ahern
On 2/6/18 7:16 PM, David Ahern wrote: > On 2/2/18 6:10 AM, Serhey Popovych wrote: >> @@ -414,15 +428,18 @@ static int do_tunnels_list(struct ip_tunnel_parm *p) >> fprintf(stderr, "Failed to get type of \"%s\"\n", name); >> continue; >> } >> -

Re: [PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups

2018-02-06 Thread David Ahern
On 2/2/18 6:10 AM, Serhey Popovych wrote: > @@ -414,15 +428,18 @@ static int do_tunnels_list(struct ip_tunnel_parm *p) > fprintf(stderr, "Failed to get type of \"%s\"\n", name); > continue; > } > - if (type != ARPHRD_TUNNEL && ty

[PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups

2018-02-02 Thread Serhey Popovych
Use switch () instead of if () to compare tunnel type to fit into 80 columns and make code more readable. Print "\n" using fputc(). In iptunnel.c abstract tunnel parameters matching code in iptunnel.c into ip_tunnel_parm_match() helper to conform with ip6tunnel.c. In ip6tunnel.c no need to call l

[RFC][PATCH iproute2-next 4/6] iptunnel/ip6tunnel: Code cleanups

2018-02-01 Thread Serhey Popovych
Use switch () instead of if () to compare tunnel type to fit into 80 columns and make code more readable. Print "\n" using fputc(). In iptunnel.c abstract tunnel parameters matching code in iptunnel.c into ip_tunnel_parm_match() helper to conform with ip6tunnel.c. In ip6tunnel.c no need to call l