network: make Link objects take references of Network objects

This commit is contained in:
Yu Watanabe
2019-05-07 16:55:19 +02:00
parent 35ac3b7664
commit c9c908a60d
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -690,6 +690,8 @@ static Link *link_free(Link *link) {
set_free_with_destructor(link->slaves, link_unref);
network_unref(link->network);
return mfree(link);
}
+2 -2
View File
@@ -358,7 +358,7 @@ int network_load_one(Manager *manager, const char *filename) {
/* To enable/disable RFC7844 Anonymity Profiles */
.dhcp_anonymize = false,
.dhcp_route_metric = DHCP_ROUTE_METRIC,
/* NOTE: this var might be overwrite by network_apply_anonymize_if_set */
/* NOTE: this var might be overwritten by network_apply_anonymize_if_set */
.dhcp_client_identifier = DHCP_CLIENT_ID_DUID,
.dhcp_route_table = RT_TABLE_MAIN,
.dhcp_route_table_set = false,
@@ -660,7 +660,7 @@ int network_apply(Network *network, Link *link) {
assert(network);
assert(link);
link->network = network;
link->network = network_ref(network);
if (network->n_dns > 0 ||
!strv_isempty(network->ntp) ||