Skip to content

Commit 61eb77c

Browse files
committed
network: drop link_load()
The link state file does not exist, as it is always removed on stop.
1 parent 6fdcef2 commit 61eb77c

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

src/network/networkd-link.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,43 +2411,6 @@ int link_initialized(Link *link, sd_device *device) {
24112411
return 0;
24122412
}
24132413

2414-
static int link_load(Link *link) {
2415-
_cleanup_free_ char *network_file = NULL;
2416-
int r;
2417-
2418-
assert(link);
2419-
2420-
r = parse_env_file(NULL, link->state_file,
2421-
"NETWORK_FILE", &network_file);
2422-
if (r < 0 && r != -ENOENT)
2423-
return log_link_error_errno(link, r, "Failed to read %s: %m", link->state_file);
2424-
2425-
if (network_file) {
2426-
Network *network;
2427-
char *suffix;
2428-
2429-
/* drop suffix */
2430-
suffix = strrchr(network_file, '.');
2431-
if (!suffix) {
2432-
log_link_debug(link, "Failed to get network name from %s", network_file);
2433-
return 0;
2434-
}
2435-
*suffix = '\0';
2436-
2437-
r = network_get_by_name(link->manager, basename(network_file), &network);
2438-
if (r < 0) {
2439-
log_link_debug_errno(link, r, "Failed to get network %s: %m", basename(network_file));
2440-
return 0;
2441-
}
2442-
2443-
r = network_apply(network, link);
2444-
if (r < 0)
2445-
return log_link_error_errno(link, r, "Failed to apply network %s: %m", basename(network_file));
2446-
}
2447-
2448-
return 0;
2449-
}
2450-
24512414
int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
24522415
_cleanup_(sd_device_unrefp) sd_device *device = NULL;
24532416
char ifindex_str[2 + DECIMAL_STR_MAX(int)];
@@ -2467,10 +2430,6 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
24672430

24682431
log_link_debug(link, "Link %d added", link->ifindex);
24692432

2470-
r = link_load(link);
2471-
if (r < 0)
2472-
return r;
2473-
24742433
if (path_is_read_only_fs("/sys") <= 0) {
24752434
/* udev should be around */
24762435
sprintf(ifindex_str, "n%d", link->ifindex);

0 commit comments

Comments
 (0)