]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-link.c
network: fix segfault in link_update_hardware_address() 20083/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 1 Jul 2021 05:52:05 +0000 (14:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 1 Jul 2021 07:24:07 +0000 (16:24 +0900)
commite2bacccd069c7f8429b84a7d9c44a9710850def1
tree0d6454442f68fa2167271e8ae9f7979def64f73d
parentcd3a828c629b42a01bfca04a432cd828458275e1
network: fix segfault in link_update_hardware_address()

This fixes a bug introduced by fe321d457c118be5d1640b586135a69d1db9270a.

When we want to update a value (in the case of this commit, it is a hardware
address) which is used as a hashmap key, we need to do the following steps:
1. remove the old hashmap entry,
2. update the value,
3. create a new hashmap entry with the new value.
src/network/networkd-link.c