mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-02 17:48:07 +02:00
ifcfg: fix crash due to not setting error on failure to parse DNS
Fixes:c2ad294290('ifcfg-rh: fix error handing in some functions that expect error != NULL') (cherry picked from commit1abf512831)
This commit is contained in:
parent
08800329e7
commit
722c7805e4
1 changed files with 10 additions and 2 deletions
|
|
@ -1987,7 +1987,11 @@ make_ip4_setting(shvarFile *ifcfg,
|
|||
} else if (nm_utils_ipaddr_is_valid(AF_INET6, v)) {
|
||||
/* Ignore IPv6 addresses */
|
||||
} else {
|
||||
PARSE_WARNING("invalid DNS server address %s", v);
|
||||
g_set_error(error,
|
||||
NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||
"Invalid DNS server address '%s'",
|
||||
v);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -2510,7 +2514,11 @@ make_ip6_setting(shvarFile *ifcfg, shvarFile *network_ifcfg, gboolean routes_rea
|
|||
} else if (nm_utils_ipaddr_is_valid(AF_INET, v)) {
|
||||
/* Ignore IPv4 addresses */
|
||||
} else {
|
||||
PARSE_WARNING("invalid DNS server address %s", v);
|
||||
g_set_error(error,
|
||||
NM_SETTINGS_ERROR,
|
||||
NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||
"Invalid DNS server address '%s'",
|
||||
v);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue