]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: drop serialization of DHCP lease
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 1 Apr 2026 14:36:30 +0000 (23:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 16 May 2026 16:31:42 +0000 (01:31 +0900)
No one use it now anymore. Let's drop it.

src/network/networkd-link.c
src/network/networkd-link.h
src/network/networkd-state-file.c

index dcd081039bf55a1dd745f34ec2b8a763d35b97a6..33275538364db0e2880e12293004c3295dfdeb9d 100644 (file)
@@ -288,7 +288,6 @@ static Link* link_free(Link *link) {
         free(link->previous_ssid);
         free(link->driver);
 
-        unlink_and_free(link->lease_file);
         unlink_and_free(link->state_file);
 
         sd_device_unref(link->dev);
@@ -2713,7 +2712,7 @@ static Link *link_drop_or_unref(Link *link) {
 DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_drop_or_unref);
 
 static int link_new(Manager *manager, sd_netlink_message *message, Link **ret) {
-        _cleanup_free_ char *ifname = NULL, *kind = NULL, *state_file = NULL, *lease_file = NULL;
+        _cleanup_free_ char *ifname = NULL, *kind = NULL, *state_file = NULL;
         _cleanup_(link_drop_or_unrefp) Link *link = NULL;
         unsigned short iftype;
         int r, ifindex;
@@ -2751,9 +2750,6 @@ static int link_new(Manager *manager, sd_netlink_message *message, Link **ret) {
                 /* Do not update state files when running in test mode. */
                 if (asprintf(&state_file, "/run/systemd/netif/links/%d", ifindex) < 0)
                         return log_oom_debug();
-
-                if (asprintf(&lease_file, "/run/systemd/netif/leases/%d", ifindex) < 0)
-                        return log_oom_debug();
         }
 
         link = new(Link, 1);
@@ -2775,7 +2771,6 @@ static int link_new(Manager *manager, sd_netlink_message *message, Link **ret) {
                 .ipv6ll_address_gen_mode = _IPV6_LINK_LOCAL_ADDRESS_GEN_MODE_INVALID,
 
                 .state_file = TAKE_PTR(state_file),
-                .lease_file = TAKE_PTR(lease_file),
 
                 .n_dns = UINT_MAX,
                 .dns_default_route = -1,
index 33c2fd35a5c21fd281083797f583e319da09324a..456ec99185624cd685b01e48a7c5c594ac67ab39 100644 (file)
@@ -117,7 +117,6 @@ typedef struct Link {
 
         sd_dhcp_client *dhcp_client;
         sd_dhcp_lease *dhcp_lease;
-        char *lease_file;
         unsigned dhcp4_messages;
         bool dhcp4_configured;
         char *dhcp4_6rd_tunnel_name;
index 7943314b06e3d5bb131735ff8ef75b83965ef5ee..3c505f39e6c95e14c5962c660549b9d02bbc8f17 100644 (file)
@@ -959,15 +959,6 @@ static int link_save(Link *link) {
         print_link_hashmap(f, "CARRIER_BOUND_TO=", link->bound_to_links);
         print_link_hashmap(f, "CARRIER_BOUND_BY=", link->bound_by_links);
 
-        if (link->dhcp_lease) {
-                r = dhcp_lease_save(link->dhcp_lease, link->lease_file);
-                if (r < 0)
-                        return r;
-
-                fprintf(f, "DHCP_LEASE=%s\n", link->lease_file);
-        } else
-                (void) unlink(link->lease_file);
-
         r = link_serialize_dhcp6_client(link, f);
         if (r < 0)
                 return r;