mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-12 15:00:16 +01:00
ip-tunnel: set cloned-mac-address only for layer2 tunnel devices
For ip-tunnel modes that encapsulate layer2 packets (gretap and ip6gretap) we allow the presence of an ethernet setting in the connection and honor the cloned-mac-address specified in it. For all other modes, the ethernet setting is removed during normalization, but a value different from 'preserve' could be set via global default. The kernel doesn't allow setting a MAC for layer3 devices, don't do it. (cherry picked from commit0494a84878) (cherry picked from commit78ed14166c) (cherry picked from commitd69d92c658)
This commit is contained in:
parent
db82b52dbd
commit
60b4bdafcf
1 changed files with 4 additions and 1 deletions
|
|
@ -970,13 +970,16 @@ set_property (GObject *object, guint prop_id,
|
|||
static NMActStageReturn
|
||||
act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
|
||||
{
|
||||
NMDeviceIPTunnel *self = NM_DEVICE_IP_TUNNEL (device);
|
||||
NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE (self);
|
||||
NMActStageReturn ret;
|
||||
|
||||
ret = NM_DEVICE_CLASS (nm_device_ip_tunnel_parent_class)->act_stage1_prepare (device, out_failure_reason);
|
||||
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
|
||||
return ret;
|
||||
|
||||
if (!nm_device_hw_addr_set_cloned (device, nm_device_get_applied_connection (device), FALSE))
|
||||
if ( _nm_ip_tunnel_mode_is_layer2 (priv->mode)
|
||||
&& !nm_device_hw_addr_set_cloned (device, nm_device_get_applied_connection (device), FALSE))
|
||||
return NM_ACT_STAGE_RETURN_FAILURE;
|
||||
|
||||
return NM_ACT_STAGE_RETURN_SUCCESS;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue