summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2018-05-30 11:47:23 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2018-06-09 15:12:31 +0200
commit93ea77505e0316c33924fb43df7f0463c9aaf4b8 (patch)
tree49222cf30397c55763958d61d2fa1dd804a88a60 /src/network
parentconf-parser: add config_parse_permille() (diff)
downloadsystemd-93ea77505e0316c33924fb43df7f0463c9aaf4b8.tar.xz
systemd-93ea77505e0316c33924fb43df7f0463c9aaf4b8.zip
networkd-link: link_configure(); factor out link_configure_can() into separate function
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c28
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. */