Use the event socket to request object via NLM_F_DUMP.
No longer use 'priv->nlh' socket to fetch objects.
Instead fetch them via the priv->nlh_event socket that also
provides asynchronous events when objects change.
That way, the events are in sync with our explicit requests
and we can directly use the events. Previously, the events were
only used to indicate that a refetch must happen, so that every
event triggered a complete dump of all addresses/routes.
We still use 'priv->nlh' to make synchronous requests such as
adding/changing/deleting objects. That means, after we send a
request, we must make sure that the result manifested itself
at 'nlh_event' socket and the platform cache.
That's why we sometimes still must force a dump to sync changes.
That could be improved by using only one netlink socket so that
we would wait for the ACK of our request.
While not yet perfect, this already significantly reduces the number of
fetches. Additionally, before, whenever requesting a dump of addresses
or routes (which we did much more often, search for "get_kernel_object for type"
log lines), we always dumped IPv4 and IPv6 together. Now only request
the addr-family in question.
https://bugzilla.gnome.org/show_bug.cgi?id=747985https://bugzilla.redhat.com/show_bug.cgi?id=1211133
Fixes for example valgrind tests for ./libnm/tests/test-nm-client:
==25772== Conditional jump or move depends on uninitialised value(s)
==25772== at 0x40198D8: index (strchr.S:106)
==25772== by 0x400777C: expand_dynamic_string_token (dl-load.c:369)
==25772== by 0x400777C: fillin_rpath (dl-load.c:439)
==25772== by 0x4007FCF: _dl_init_paths (dl-load.c:816)
==25772== by 0x4002F38: dl_main (rtld.c:1194)
==25772== by 0x401750F: _dl_sysdep_start (dl-sysdep.c:249)
==25772== by 0x4004C20: _dl_start_final (rtld.c:306)
==25772== by 0x4004C20: _dl_start (rtld.c:412)
==25772== by 0x4000C97: ??? (in /usr/lib64/ld-2.21.so)
==25772== by 0x1: ???
==25772== by 0xFFEFFF6B2: ???
==25772== by 0xFFEFFF6EF: ???
==25772==
{
<insert_a_suppression_name_here>
Memcheck:Cond
fun:index
fun:expand_dynamic_string_token
fun:fillin_rpath
fun:_dl_init_paths
fun:dl_main
fun:_dl_sysdep_start
fun:_dl_start_final
fun:_dl_start
obj:/usr/lib64/ld-2.21.so
obj:*
obj:*
obj:*
}
Add a comment about the upstream bug that fixes
the suppressed memleak in libnl.
Also, add a different backtrace for the same bug.
It currently doesn't hit easily, because we don't
call nl_msg_parse() often. In the future we will
though.
It appears that the .isra and .part pieces can change depending on
how glib was built, so ignore those parts. Add some new suppressions
for newer glib too.
Make some suppressions more generic, because they
did not match on my F20.
The previous suppression for 'fun:gobject_init_ctor'
also had a syntax error. Fix that too.
Signed-off-by: Thomas Haller <thaller@redhat.com>
`make check` '--with-valgrind=yes' failed due to memory leaks detected
by valgrind. These leaks originate from glib structures, and should be
ignored.
https://bugzilla.gnome.org/show_bug.cgi?id=705160
Signed-off-by: Thomas Haller <thaller@redhat.com>
This suppression didn't work on F17 for some reason, even though the
stacktrace was the same. Valgrind wanted some kind of:
obj:<path to libglib>
between the calloc and the g_malloc0 lines; but we don't actually
care much about the calloc anyway.
Create the new nm-platform framework and implement link (or interface)
management. The nm-platform serves as the point of contact between
the rest of NetworkManager and the operating system.
There are two backends for nm-platform:
* NMFakePlatform: Fake kernel backend for testing purposes
* NMLinuxPlatform: Linux kernel backend for actual use
A comprehensive testsuite is included and will be extended with new
feature additions. To enable the Linux part of the testsuite, use
--enable-tests=root configure options and run 'make check' as root.
Use --enable-code-coverage for code coverage support.
./autogen.sh --enable-tests=root --enable-code-coverage
make
make -C src/platform check-code-coverage
Link features:
* Retrieve the list of links
* Translate between indexes and names
* Discover device type
* Add/remove dummy interfaces (for testing)
Thanks to Thomas Graf for helping with libnl3 synchronization issues.