summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index fdc351fed3..39cef2254c 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1383,7 +1383,12 @@ int link_save(Link *link) {
link_state_to_string(link->state));
if (link->dhcp_lease) {
- const char *lease_file = "/run/systemd/network/leases/test.lease";
+ char *lease_file;
+
+ r = asprintf(&lease_file, "/run/systemd/network/leases/%u",
+ (unsigned) link->ifindex);
+ if (r < 0)
+ return r;
r = dhcp_lease_save(link->dhcp_lease, lease_file);
if (r < 0)