diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-03-01 13:27:47 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-03-13 11:59:18 +0900 |
commit | fcbf4cb7270faa2624a0cf149f9518280e8a6714 (patch) | |
tree | b64aa98c4b00aec29b3c3b8f216a2cb712e78178 /src/network/networkd-neighbor.c | |
parent | 9560e5b3235e30eea2873e507d27ed00331d838c (diff) | |
download | systemd-fcbf4cb7270faa2624a0cf149f9518280e8a6714.tar.gz |
network: drop sections contain invalid settings in network_verify()
If e.g., an [Address] section has an invalid setting, then
previously assigned settings in the section is freed, and
only later settings are stored. That may cause partially broken
section stored in Network object.
This makes if an invalid setting is found, then set 'invalid' flag
instead of freeing it. And invalid sections are dropped later by
network_verify().
Diffstat (limited to 'src/network/networkd-neighbor.c')
-rw-r--r-- | src/network/networkd-neighbor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c index 713bad2bba..d0275fdd3e 100644 --- a/src/network/networkd-neighbor.c +++ b/src/network/networkd-neighbor.c @@ -164,7 +164,7 @@ int config_parse_neighbor_address(const char *unit, void *userdata) { Network *network = userdata; - _cleanup_(neighbor_freep) Neighbor *n = NULL; + _cleanup_(neighbor_free_or_set_invalidp) Neighbor *n = NULL; int r; assert(filename); @@ -200,7 +200,7 @@ int config_parse_neighbor_hwaddr(const char *unit, void *userdata) { Network *network = userdata; - _cleanup_(neighbor_freep) Neighbor *n = NULL; + _cleanup_(neighbor_free_or_set_invalidp) Neighbor *n = NULL; int r; assert(filename); |