From: Marc Kleine-Budde Date: Wed, 30 May 2018 09:47:23 +0000 (+0200) Subject: networkd-link: link_configure(); factor out link_configure_can() into separate function X-Git-Tag: v239~101^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93ea77505e0316c33924fb43df7f0463c9aaf4b8;p=thirdparty%2Fsystemd.git networkd-link: link_configure(); factor out link_configure_can() into separate function --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index c714cd4fc72..ed87ab8d622 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2599,6 +2599,20 @@ static int link_update_lldp(Link *link) { return r; } +static int link_configure_can(Link *link) { + int r; + + if (!(link->flags & IFF_UP)) { + r = link_up_can(link); + if (r < 0) { + link_enter_failed(link); + return r; + } + } + + return 0; +} + static int link_configure(Link *link) { int r; @@ -2606,18 +2620,8 @@ static int link_configure(Link *link) { assert(link->network); assert(link->state == LINK_STATE_PENDING); - if (streq_ptr(link->kind, "vcan")) { - - if (!(link->flags & IFF_UP)) { - r = link_up_can(link); - if (r < 0) { - link_enter_failed(link); - return r; - } - } - - return 0; - } + if (streq_ptr(link->kind, "vcan")) + return link_configure_can(link); /* Drop foreign config, but ignore loopback or critical devices. * We do not want to remove loopback address or addresses used for root NFS. */