network: update tunnel or vxlan interface if the local address is changed

If a tunnel or vxlan is configured with Local=dhcp4 or so, then the
local address needs to be changed when it is changed.

Fixes #24854.
This commit is contained in:
Yu Watanabe
2024-10-31 18:41:44 +09:00
parent 5310cf3354
commit b8b0c1a065
10 changed files with 75 additions and 2 deletions
+6
View File
@@ -8,6 +8,7 @@
#include "hash-funcs.h"
#include "list.h"
#include "log-link.h"
#include "netdev-util.h"
#include "networkd-link.h"
#include "time-util.h"
@@ -186,6 +187,10 @@ typedef struct NetDevVTable {
/* provides if MTU can be set. If this is not set, assumed to be yes. */
bool (*can_set_mtu)(NetDev *netdev, uint32_t mtu);
/* provides if the netdev needs to be reconfigured when a specified type of address on the underlying
* interface is updated. */
bool (*needs_reconfigure)(NetDev *netdev, NetDevLocalAddressType type);
/* expected iftype, e.g. ARPHRD_ETHER. */
uint16_t iftype;
@@ -237,6 +242,7 @@ int netdev_set_ifindex(NetDev *netdev, sd_netlink_message *newlink);
int netdev_generate_hw_addr(NetDev *netdev, Link *link, const char *name,
const struct hw_addr_data *hw_addr, struct hw_addr_data *ret);
bool netdev_needs_reconfigure(NetDev *netdev, NetDevLocalAddressType type);
int link_request_stacked_netdev(Link *link, NetDev *netdev);
const char* netdev_kind_to_string(NetDevKind d) _const_;