]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: drop duplicated information from link state file
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 Jun 2020 14:35:09 +0000 (23:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Jun 2020 10:13:05 +0000 (19:13 +0900)
Those entries are already in DHCP4 lease file, and not used anymore.

src/network/networkd-link.c

index afeb36d315bbff0fb449417e454ba51fd8b3911f..94806be5e6e087b265f42fabd1fec4b2ef14c654 100644 (file)
@@ -4351,33 +4351,6 @@ int link_save(Link *link) {
         print_link_hashmap(f, "CARRIER_BOUND_BY=", link->bound_by_links);
 
         if (link->dhcp_lease) {
-                struct in_addr address;
-                const char *tz = NULL;
-                size_t client_id_len;
-                const void *client_id;
-
-                assert(link->network);
-
-                r = sd_dhcp_lease_get_timezone(link->dhcp_lease, &tz);
-                if (r >= 0)
-                        fprintf(f, "TIMEZONE=%s\n", tz);
-
-                r = sd_dhcp_lease_get_address(link->dhcp_lease, &address);
-                if (r >= 0) {
-                        fputs("DHCP4_ADDRESS=", f);
-                        serialize_in_addrs(f, &address, 1, NULL, NULL);
-                        fputc('\n', f);
-                }
-
-                r = sd_dhcp_lease_get_client_id(link->dhcp_lease, &client_id, &client_id_len);
-                if (r >= 0) {
-                        _cleanup_free_ char *id = NULL;
-
-                        r = sd_dhcp_client_id_to_string(client_id, client_id_len, &id);
-                        if (r >= 0)
-                                fprintf(f, "DHCP4_CLIENT_ID=%s\n", id);
-                }
-
                 r = dhcp_lease_save(link->dhcp_lease, link->lease_file);
                 if (r < 0)
                         goto fail;