mirror of
https://github.com/systemd/systemd.git
synced 2026-08-02 22:20:20 +00:00
network/ipvlan: do not try to update MAC address
This commit is contained in:
@@ -37,6 +37,13 @@ static int netdev_ipvlan_fill_message_create(NetDev *netdev, Link *link, sd_netl
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool ipvlan_can_set_mac(NetDev *netdev, const struct hw_addr_data *hw_addr) {
|
||||
assert(netdev);
|
||||
|
||||
/* MAC address cannot be updated. Even unchanged, IFLA_ADDRESS attribute cannot be set in the message. */
|
||||
return netdev->ifindex <= 0;
|
||||
}
|
||||
|
||||
static void ipvlan_init(NetDev *netdev) {
|
||||
IPVlan *m = ASSERT_PTR(netdev)->kind == NETDEV_KIND_IPVLAN ? IPVLAN(netdev) : IPVTAP(netdev);
|
||||
|
||||
@@ -50,6 +57,7 @@ const NetDevVTable ipvlan_vtable = {
|
||||
.sections = NETDEV_COMMON_SECTIONS "IPVLAN\0",
|
||||
.fill_message_create = netdev_ipvlan_fill_message_create,
|
||||
.create_type = NETDEV_CREATE_STACKED,
|
||||
.can_set_mac = ipvlan_can_set_mac,
|
||||
.iftype = ARPHRD_ETHER,
|
||||
.generate_mac = true,
|
||||
};
|
||||
@@ -60,6 +68,7 @@ const NetDevVTable ipvtap_vtable = {
|
||||
.sections = NETDEV_COMMON_SECTIONS "IPVTAP\0",
|
||||
.fill_message_create = netdev_ipvlan_fill_message_create,
|
||||
.create_type = NETDEV_CREATE_STACKED,
|
||||
.can_set_mac = ipvlan_can_set_mac,
|
||||
.iftype = ARPHRD_ETHER,
|
||||
.generate_mac = true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user