summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-10-28 15:48:34 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-10-28 18:16:01 +0900
commit61eb77c4b6784ca3244dbbc0f292e051f18eab71 (patch)
treeb1031e1b97de9d5fae47eaecd8d46ba97957059b
parent6fdcef2174cb372bbc66050761e22f6b17139617 (diff)
downloadsystemd-61eb77c4b6784ca3244dbbc0f292e051f18eab71.tar.gz
network: drop link_load()
The link state file does not exist, as it is always removed on stop.
-rw-r--r--src/network/networkd-link.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 6b6f772c88..d224842c09 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2411,43 +2411,6 @@ int link_initialized(Link *link, sd_device *device) {
return 0;
}
-static int link_load(Link *link) {
- _cleanup_free_ char *network_file = NULL;
- int r;
-
- assert(link);
-
- r = parse_env_file(NULL, link->state_file,
- "NETWORK_FILE", &network_file);
- if (r < 0 && r != -ENOENT)
- return log_link_error_errno(link, r, "Failed to read %s: %m", link->state_file);
-
- if (network_file) {
- Network *network;
- char *suffix;
-
- /* drop suffix */
- suffix = strrchr(network_file, '.');
- if (!suffix) {
- log_link_debug(link, "Failed to get network name from %s", network_file);
- return 0;
- }
- *suffix = '\0';
-
- r = network_get_by_name(link->manager, basename(network_file), &network);
- if (r < 0) {
- log_link_debug_errno(link, r, "Failed to get network %s: %m", basename(network_file));
- return 0;
- }
-
- r = network_apply(network, link);
- if (r < 0)
- return log_link_error_errno(link, r, "Failed to apply network %s: %m", basename(network_file));
- }
-
- return 0;
-}
-
int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
_cleanup_(sd_device_unrefp) sd_device *device = NULL;
char ifindex_str[2 + DECIMAL_STR_MAX(int)];
@@ -2467,10 +2430,6 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
log_link_debug(link, "Link %d added", link->ifindex);
- r = link_load(link);
- if (r < 0)
- return r;
-
if (path_is_read_only_fs("/sys") <= 0) {
/* udev should be around */
sprintf(ifindex_str, "n%d", link->ifindex);