From 7751af5f3879781aef0e3f722eaef4811fdb81aa Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 21 Nov 2020 12:01:21 +0000 Subject: [PATCH] Improve readability. --- src/dhcpcd.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 5892a28b..205635e7 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -991,17 +991,20 @@ void dhcpcd_activateinterface(struct interface *ifp, unsigned long long options) { - if (!ifp->active) { - ifp->active = IF_ACTIVE; - dhcpcd_initstate2(ifp, options); - /* It's possible we might not have been able to load - * a config. */ - if (ifp->active) { - configure_interface1(ifp); - run_preinit(ifp); - dhcpcd_prestartinterface(ifp); - } - } + if (ifp->active) + return; + + ifp->active = IF_ACTIVE; + dhcpcd_initstate2(ifp, options); + + /* It's possible we might not have been able to load + * a config. */ + if (!ifp->active) + return; + + configure_interface1(ifp); + run_preinit(ifp); + dhcpcd_prestartinterface(ifp); } int -- 2.47.3