summaryrefslogtreecommitdiff
path: root/src/network/networkd-address.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-09-30 15:32:16 +0200
committerTom Gundersen <teg@jklm.no>2015-10-21 03:24:23 +0200
commite7780c8d44ee32ecf6127f45c0188483c041e2e5 (patch)
tree4ad7a73209e65ea76b6655e53639931c504dc4a2 /src/network/networkd-address.c
parentbb7ae737a36769553475b1ada882b06869b75b00 (diff)
networkd: link - serialize addresses
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r--src/network/networkd-address.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index da458dcb64..8b3694d07f 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -98,6 +98,7 @@ void address_free(Address *address) {
if (address->link) {
set_remove(address->link->addresses, address);
set_remove(address->link->addresses_foreign, address);
+ link_save(address->link);
}
free(address);
@@ -270,7 +271,15 @@ int address_add_foreign(Link *link, int family, const union in_addr_union *in_ad
}
static int address_add(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret) {
- return address_add_internal(link, &link->addresses, family, in_addr, prefixlen, ret);
+ int r;
+
+ r = address_add_internal(link, &link->addresses, family, in_addr, prefixlen, ret);
+ if (r < 0)
+ return r;
+
+ link_save(link);
+
+ return 0;
}
static int address_release(Address *address) {