mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 07:00:13 +01:00
device: implement flag NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER for is_available()
This commit is contained in:
parent
52dbb2398a
commit
37ebeccaa7
2 changed files with 9 additions and 1 deletions
|
|
@ -1738,7 +1738,13 @@ is_available (NMDevice *self, NMDeviceCheckDevAvailableFlags flags)
|
|||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
|
||||
return priv->carrier || priv->ignore_carrier;
|
||||
if (priv->carrier || priv->ignore_carrier)
|
||||
return TRUE;
|
||||
|
||||
if (NM_FLAGS_HAS (flags, NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ typedef enum NMActStageReturn NMActStageReturn;
|
|||
* not available if it would be available otherwise. */
|
||||
typedef enum {
|
||||
NM_DEVICE_CHECK_CON_AVAILABLE_NONE = 0,
|
||||
|
||||
NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST = (1L << 0),
|
||||
|
||||
__NM_DEVICE_CHECK_CON_AVAILABLE_ALL,
|
||||
|
|
@ -107,6 +108,7 @@ struct _NMDevice {
|
|||
* a device appear more available. It can never make a device less available. */
|
||||
typedef enum {
|
||||
NM_DEVICE_CHECK_DEV_AVAILABLE_NONE = 0,
|
||||
NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER = (1L << 0),
|
||||
|
||||
__NM_DEVICE_CHECK_DEV_AVAILABLE_ALL,
|
||||
NM_DEVICE_CHECK_DEV_AVAILABLE_ALL = (((__NM_DEVICE_CHECK_DEV_AVAILABLE_ALL - 1) << 1) - 1),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue