mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 10:14:41 +00:00
libnm-core: minor cleanup checks in "nm-setting-adsl.c"'s verify()
This commit is contained in:
parent
d3e5eab734
commit
607a22b900
|
@ -158,7 +158,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
_("property is missing"));
|
||||
g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_USERNAME);
|
||||
return FALSE;
|
||||
} else if (!strlen (priv->username)) {
|
||||
}
|
||||
if (!priv->username[0]) {
|
||||
g_set_error_literal (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
|
@ -167,10 +168,9 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if ( !priv->protocol
|
||||
|| ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
|
||||
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
|
||||
&& strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_IPOATM))){
|
||||
if (!NM_IN_STRSET (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA,
|
||||
NM_SETTING_ADSL_PROTOCOL_PPPOE,
|
||||
NM_SETTING_ADSL_PROTOCOL_IPOATM)) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
|
@ -180,9 +180,9 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if ( priv->encapsulation
|
||||
&& ( strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_VCMUX)
|
||||
&& strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_LLC) )) {
|
||||
if (!NM_IN_STRSET (priv->encapsulation, NULL,
|
||||
NM_SETTING_ADSL_ENCAPSULATION_VCMUX,
|
||||
NM_SETTING_ADSL_ENCAPSULATION_LLC)) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
|
|
Loading…
Reference in a new issue