mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 00:10:11 +01:00
shared: add debugging statement for assertion in nm_utils_parse_inaddr_bin_full()
There are crashes where this assertion fails, but it's not clear how that could happen (because the input text seems a usual IPv4 address). Try to collect some more information about what failed. It's only enabled with NM_MORE_ASSERTS anyway. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1797915
This commit is contained in:
parent
df6129d93a
commit
90c5d1d99c
1 changed files with 5 additions and 1 deletions
|
|
@ -784,7 +784,11 @@ nm_utils_parse_inaddr_bin_full (int addr_family,
|
|||
|
||||
/* The legacy parser should accept everything that inet_pton() accepts too. Meaning,
|
||||
* it should strictly parse *more* formats. And of course, parse it the same way. */
|
||||
nm_assert (_parse_legacy_addr4 (text, &a));
|
||||
if (!_parse_legacy_addr4 (text, &a)) {
|
||||
char buf[INET_ADDRSTRLEN];
|
||||
|
||||
g_error ("unexpected assertion failure: could parse \"%s\" as %s, but not accepted by legacy parser", text, _nm_utils_inet4_ntop (addrbin.addr4, buf));
|
||||
}
|
||||
nm_assert (addrbin.addr4 == a);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue