summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-22 19:36:40 +0200
committerTom Gundersen <teg@jklm.no>2014-04-22 21:06:00 +0200
commit45ad2c132827b0ab5854ec52068659f246c59cf8 (patch)
tree453075c4ddf68380b40561059f0b9308750e8afc /src
parent124fa2c601c6fbbc3751b744c6f68bd522e0c588 (diff)
networkd: link - don't react to successfull link up
Avoid having two code-paths racing with eacother to do the same thing. The change of flags will be detected in the normal way, so only use the link_up_handler to detect if the 'up' failed and in that case fail the link.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 9f632e4f1e..723b919a5e 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1242,14 +1242,15 @@ static int link_up_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
return 1;
r = sd_rtnl_message_get_errno(m);
- if (r >= 0)
- link_update_flags(link, link->flags | IFF_UP);
- else
+ if (r < 0) {
log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not bring up interface: %s",
link->ifname, strerror(-r),
"ERRNO=%d", -r,
NULL);
+ link_enter_failed(link);
+ }
+
return 1;
}
@@ -1446,6 +1447,7 @@ static int link_configure(Link *link) {
if (link->network->ipv4ll) {
uint8_t seed[8];
+
r = sd_ipv4ll_new(&link->ipv4ll);
if (r < 0)
return r;