Mercurial > hg > dhcpcd
diff src/dhcpcd.c @ 5547:c9182c3618e6 draft
Improve readability.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sat, 21 Nov 2020 12:01:21 +0000 |
| parents | fc24946f9b2a |
| children | dba7608e00b3 |
line wrap: on
line diff
--- a/src/dhcpcd.c Sat Nov 21 11:59:07 2020 +0000 +++ b/src/dhcpcd.c Sat Nov 21 12:01:21 2020 +0000 @@ -991,17 +991,20 @@ 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
