summaryrefslogtreecommitdiff
path: root/src/network/networkd-fdb.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-07-15 00:35:49 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-07-15 21:52:06 +0900
commit4ff296b02411bb4f0dc38f48cbab06f8645d2a08 (patch)
treec2a6711e50df7eb96553f8cd3723abdb4a1eaf44 /src/network/networkd-fdb.c
parent8eb0cafeb0aa6687e02f45e92e60fdbad7c485c0 (diff)
downloadsystemd-4ff296b02411bb4f0dc38f48cbab06f8645d2a08.tar.gz
systemd-4ff296b02411bb4f0dc38f48cbab06f8645d2a08.tar.bz2
systemd-4ff296b02411bb4f0dc38f48cbab06f8645d2a08.zip
network: make link enter failed state when a configuration fails
Some path of configuring address, route or etc., go to failed state, but some do not. E.g., failure in address configuration which is provided by DHCPv4 goes to failed state, but static address does not. This is just for consistency. This should not change anything if everything is fine. This also voidify manager_rtnl_process_address().
Diffstat (limited to 'src/network/networkd-fdb.c')
-rw-r--r--src/network/networkd-fdb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/networkd-fdb.c b/src/network/networkd-fdb.c
index 5b7468c103..d7c7e33096 100644
--- a/src/network/networkd-fdb.c
+++ b/src/network/networkd-fdb.c
@@ -100,9 +100,15 @@ static int set_fdb_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link)
assert(link);
+ if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
+ return 1;
+
r = sd_netlink_message_get_errno(m);
- if (r < 0 && r != -EEXIST)
+ if (r < 0 && r != -EEXIST) {
log_link_error_errno(link, r, "Could not add FDB entry: %m");
+ link_enter_failed(link);
+ return 1;
+ }
return 1;
}