mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-13 22:30:17 +01:00
libnm-core: add _nm_ip_tunnel_mode_is_layer2()
(cherry picked from commit48c93b3bba) (cherry picked from commit5d2f2a6549) (cherry picked from commitd0f275e7f5)
This commit is contained in:
parent
53cb8ce245
commit
db82b52dbd
2 changed files with 13 additions and 3 deletions
|
|
@ -875,4 +875,8 @@ gboolean nm_utils_connection_is_adhoc_wpa (NMConnection *connection);
|
|||
|
||||
const char *nm_utils_wifi_freq_to_band (guint32 freq);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
gboolean _nm_ip_tunnel_mode_is_layer2 (NMIPTunnelMode mode);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -305,6 +305,14 @@ nm_setting_ip_tunnel_get_flags (NMSettingIPTunnel *setting)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
gboolean
|
||||
_nm_ip_tunnel_mode_is_layer2 (NMIPTunnelMode mode)
|
||||
{
|
||||
return NM_IN_SET (mode,
|
||||
NM_IP_TUNNEL_MODE_GRETAP,
|
||||
NM_IP_TUNNEL_MODE_IP6GRETAP);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||
{
|
||||
|
|
@ -458,9 +466,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
}
|
||||
|
||||
if ( nm_connection_get_setting_wired (connection)
|
||||
&& !NM_IN_SET (priv->mode,
|
||||
NM_IP_TUNNEL_MODE_GRETAP,
|
||||
NM_IP_TUNNEL_MODE_IP6GRETAP)) {
|
||||
&& !_nm_ip_tunnel_mode_is_layer2 (priv->mode)) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue