mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 22:00:13 +01:00
device: turn off "unmanaged unless IFF_UP externally" for veth
We currently don't manage a veth inside a container despite we should because
it's an externally configured software interface and thus waits for IFF_UP.
Given veths are prevented from being managed outside of a container by an udev
rule anyway it's safe to lift the external IFF_UP requirement for them.
(cherry picked from commit bcc79cc0eb)
This commit is contained in:
parent
cde17da19b
commit
a8dd15d745
1 changed files with 12 additions and 0 deletions
|
|
@ -96,6 +96,15 @@ get_peer (NMDeviceVeth *self)
|
|||
return priv->peer;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
can_unmanaged_external_down (NMDevice *self)
|
||||
{
|
||||
/* Unless running in a container, an udev rule causes these to be
|
||||
* unmanaged. If there's no udev then we're probably in a container
|
||||
* and should IFF_UP and configure the veth ourselves even if we
|
||||
* didn't create it. */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
|
||||
|
|
@ -140,12 +149,15 @@ static void
|
|||
nm_device_veth_class_init (NMDeviceVethClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (klass, sizeof (NMDeviceVethPrivate));
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->dispose = dispose;
|
||||
|
||||
device_class->can_unmanaged_external_down = can_unmanaged_external_down;
|
||||
|
||||
/* properties */
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_PEER,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue