diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-05-30 11:47:23 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-06-09 15:12:31 +0200 |
commit | 93ea77505e0316c33924fb43df7f0463c9aaf4b8 (patch) | |
tree | 49222cf30397c55763958d61d2fa1dd804a88a60 /src/network | |
parent | c07b23ca7ec8a90e51379595e056eda028bd58d8 (diff) | |
download | systemd-93ea77505e0316c33924fb43df7f0463c9aaf4b8.tar.gz |
networkd-link: link_configure(); factor out link_configure_can() into separate function
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-link.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index c714cd4fc7..ed87ab8d62 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. */ |