mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-11 14:10:31 +01:00
libnm: add _nm_setting_wired_is_valid_s390_option_value() validation function
This commit is contained in:
parent
ddc41d427a
commit
e25c458b6f
2 changed files with 9 additions and 1 deletions
|
|
@ -816,7 +816,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
NM_SETTING_WIRED_S390_OPTIONS);
|
||||
return FALSE;
|
||||
}
|
||||
if (v->value_str[0] == '\0' || strlen(v->value_str) > 200u) {
|
||||
if (!_nm_setting_wired_is_valid_s390_option_value(v->value_str)) {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
|
|
|
|||
|
|
@ -312,6 +312,14 @@ _nm_ip_address_get_attribute_names(const NMIPAddress *addr, gboolean sorted, gui
|
|||
void _nm_setting_wired_clear_s390_options(NMSettingWired *setting);
|
||||
gboolean _nm_setting_wired_is_valid_s390_option(const char *option);
|
||||
|
||||
#define NM_SETTING_WIRED_S390_OPTION_MAX_LEN 200u
|
||||
|
||||
static inline gboolean
|
||||
_nm_setting_wired_is_valid_s390_option_value(const char *option)
|
||||
{
|
||||
return option && option[0] != '\0' && strlen(option) <= NM_SETTING_WIRED_S390_OPTION_MAX_LEN;
|
||||
}
|
||||
|
||||
gboolean _nm_ip_route_attribute_validate_all(const NMIPRoute *route, GError **error);
|
||||
const char **
|
||||
_nm_ip_route_get_attribute_names(const NMIPRoute *route, gboolean sorted, guint *out_length);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue