Re: [iproute PATCH 05/12] ip{,6}tunnel: align do_tunnels_list() a bit

2015-11-13 Thread Phil Sutter
On Fri, Nov 13, 2015 at 05:30:10PM +, David Laight wrote: > From: Phil Sutter > > Sent: 13 November 2015 17:09 > > In iptunnel, declare loop variables inside the loop as done in > > ip6tunnel. > ... > > @@ -396,14 +396,8 @@ static void print_tunnel(struct ip_tunnel_parm *p) > > > > static int

RE: [iproute PATCH 05/12] ip{,6}tunnel: align do_tunnels_list() a bit

2015-11-13 Thread David Laight
From: Phil Sutter > Sent: 13 November 2015 17:09 > In iptunnel, declare loop variables inside the loop as done in > ip6tunnel. ... > @@ -396,14 +396,8 @@ static void print_tunnel(struct ip_tunnel_parm *p) > > static int do_tunnels_list(struct ip_tunnel_parm *p) > { > - char name[IFNAMSIZ]; >

[iproute PATCH 05/12] ip{,6}tunnel: align do_tunnels_list() a bit

2015-11-13 Thread Phil Sutter
In iptunnel, declare loop variables inside the loop as done in ip6tunnel. Fix and simplify goto logic in ip6tunnel: - Failure to read over header lines would have left fp opened. - By returning directly upon fopen() failure, fp can be closed unconditionally in the end. Use the same goto logic i