diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2015-11-27 11:30:41 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2015-11-27 14:41:20 +0100 |
commit | 32b977a5336612a5c01f7426c4d165685fa8aca0 (patch) | |
tree | 937fc48205929ecc28365e01e2be47b5477c3385 /src/config.c | |
parent | 01d3f9d64486ac1daa144848944e877e7f0cb762 (diff) |
config: Close interface when ifindex cannot be resolved
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c index 7d870f1..4fc8bc7 100644 --- a/src/config.c +++ b/src/config.c @@ -313,13 +313,13 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr } if (!iface->ifname[0] && !ifname) - return -1; + goto err; if (ifname) strncpy(iface->ifname, ifname, sizeof(iface->ifname) - 1); if ((iface->ifindex = if_nametoindex(iface->ifname)) <= 0) - return -1; + goto err; iface->inuse = true; |