]> git.proxmox.com Git - qemu-server.git/commit
config: net: avoid duplicate ipam entries on nic update
authorStefan Hanreich <s.hanreich@proxmox.com>
Wed, 17 Jul 2024 13:06:02 +0000 (15:06 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Jul 2024 16:38:05 +0000 (18:38 +0200)
commit0565f489ffa3818f17f83400d782d2bf00caa91f
tree34ebb018f6143a81457f3cbd9e42833136532029
parent1c5001c2e7f8b73cdcf192d23714985eaddc17ed
config: net: avoid duplicate ipam entries on nic update

Updating the NIC of a VM when the following conditions were met:
* VM is turned off
* NIC is on a bridge that uses automatic dhcp
* Leave bridge unchanged

led to duplicate IPAM entries for the same network device.

This is due to the fact that the add_next_free_cidr always ran on
applying pending network changes.

Now we only add a new ipam entry if either:
* the value of the bridge or mac address changed
* the network device has been newly added

This way no duplicate IPAM entries should get created.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
PVE/QemuServer.pm