]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip{,6}tunnel: align do_tunnels_list() a bit
authorPhil Sutter <phil@nwl.cc>
Fri, 13 Nov 2015 17:08:58 +0000 (18:08 +0100)
committerStephen Hemminger <shemming@brocade.com>
Mon, 23 Nov 2015 23:26:37 +0000 (15:26 -0800)
commitc4527d7ba36edd214d5e1a700affd5bf89c5cecc
treec4bb6267ccd7ae3aeeefc05fb2063523dec37a21
parent4b3cb96281ebf39fa63734c7879fbf078d1bfa7b
ip{,6}tunnel: align do_tunnels_list() a bit

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 in iptunnel, as well.

Signed-off-by: Phil Sutter <phil@nwl.cc>
ip/ip6tunnel.c
ip/iptunnel.c