network/netdev: replace old NetDev object with newer one on reload
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 27 Oct 2024 07:38:24 +0000 (16:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Oct 2024 20:30:40 +0000 (05:30 +0900)
commitb3ae4e8622c04f5653a476d40cdef243827eedd5
tree3423b206d15045742d31d09768b36d9c9788346b
parent890bd7225a68cc9ff9207442b37285f8b009eb47
network/netdev: replace old NetDev object with newer one on reload

Then, when a .netdev file of a stacked netdev is modified, the netdev
can be reconfigured with the updated setting by something like the
following way:
```
ip link del vlan99
networkctl reload
```

Note, removing the vlan interface in the above example may not be necessary,
e.g. when only VLAN flags, egress mapping, or ingress mapping are updated.
But, it is necessary when VLAN ID is updated.

Closes #9627.
Closes #27177.
Closes #34907.
Replaces #22557.
src/network/netdev/netdev.c
src/network/netdev/netdev.h
src/network/networkd-manager.c