summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c
index fd8f32e..e79f9ce 100644
--- a/src/config.c
+++ b/src/config.c
@@ -440,10 +440,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if (!iface->ifname)
goto err;
- }
- if ((iface->ifindex = if_nametoindex(iface->ifname)) <= 0)
- goto err;
+ if (!iface->ifindex &&
+ (iface->ifindex = if_nametoindex(iface->ifname)) <= 0)
+ goto err;
+ }
if (get_addrs) {
ssize_t len = odhcpd_get_interface_addresses(iface->ifindex,