Configuration commit is an unsafe thing to do for assumed connections,
it can remove an externally added address we don't know about yet.
The device already has a link-local address; for an assumed connection
it's the reason we assumed the method=link-local in the first place.
(cherry picked from commit 396dc2b3b4)
Paths to sysctls don't use ifindex and device names can be reused. If someone
removes a device and quickly creates a device with the same name, chances are
we're cleaning up the device that was just added.
Sadly, it seems there's no better API than sysctl-- neither netlink nor procfs
symlinks with ifindex or anything like that.
(cherry picked from commit f85513b8e4)
There won't be any further requests, so there's no point in keeping
the connection alive. Even if the HTTP server doesn't care, proxy
servers in-between might keep the connection open for a couple seconds
for keepalive, and we might as well be nice to them and tell them we
don't need to keep it alive.
(cherry picked from commit 90692e3eff)
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.
(cherry picked from commit 3cde821344)
When a new connection is activated and presently active connection goes away,
the active-connection-removed signal is not emitted for the old connection.
This is what happens:
1.) Initially, nm-manager::active-connections = [ActiveConnection/old]
2.) First PropertyChange is signalled for the new connection addition:
nm-manager::active-connections = [ActiveConnection/old,ActiveConnection/new]
This triggers load of ActiveConnection/new object.
3.) Another PropertyChange is signalled for the old connection removal:
nm-manager::active-connections = [ActiveConnection/new]
This removes the ActiveConnection/old object from
nm-manager::active-connections and enqueues active-connection-removed
signal. The signal is not emmitted as there's a reload from 2.) in progress.
4.) ActiveConnection/new reload finished
object_property_complete() compares
[ActiveConnection/old,ActiveConnection/new] from its odata to current
nm-manager::active-connections and incorrectly concludes that
ActiveConnection/old was just added and removes the enqueued
active-connection-removed signal.
This patch fixes the issue by remembering the original
nm-manager::active-connections property value at 2.).
[thaller@redhat.com: fixed an integer overflow and odata->array unreffing]
https://bugzilla.redhat.com/show_bug.cgi?id=1079353
(cherry picked from commit dba4e8ece8)
Backport several memleak fixes from master and enable
VALGRIND for most tests.
With valgrind enabled, I get sometimes non-reproducible failures
in src/tests/test-general-with-expect (monotonic_timestamp_get())
and libnm/tests/test-nm-client.c:911.
Still, merge it to have tests enabled in the first place. Possibly
fix them later.
https://mail.gnome.org/archives/networkmanager-list/2015-March/msg00041.html
We don't need the bus for the tests and the manager may warn when it
is not available.
$ (cd src/tests/config/; env -i DBUS_SYSTEM_BUS_ADDRESS=meow ./test-config)
/config/parse-error: OK
/config/no-auto-default: NetworkManager-Message: <info> Could not connect to the system bus; only the private D-Bus socket will be available.
/bin/sh: line 5: 29997 Trace/breakpoint trap ${dir}$tst
FAIL: test-config
This reverts commit 6994454461 for the
most part. It's not sufficient to disable logging warnings. Creating
a DBus Manager might affect the system in undesired ways.
(cherry picked from commit 5040a8a851)
The class itself is not thread-safe, so no need for guarding
the creation with g_once_init_*().
Also, assert against multiple creation and log a line when
creating the singleton. The getter is now more similar to what
is created by NM_DEFINE_SINGLETON_GETTER().
(cherry picked from commit 99465a34ca)
Don't have the singleton instance of NMDBusManager owned by
the main function. Instead use NM_DEFINE_SINGLETON_DESTRUCTOR()
which also logs what's happening.
(cherry picked from commit 1208c0dd13)
Conflicts:
src/main.c
When configuring with --with-valgrind, tests will be invoked
via valgrind. That significantly slows down the tests. Allow
user to set the environment variable NMTST_NO_VALGRIND to invoke
tests directly, even when valgrind was enabled at configure time.
(cherry picked from commit 95a750e4fa)
Otherwise the compiler complains that they could be left uninitialized in case
the function returns too early.
Fixes: 76745817c3
(cherry picked from commit 2981839bde)
Fix memleaks and enable valgrind checks for most unit tests except
ifupdown plugin. For ifupdown tests, there are some leaks that are
not yet fixed. This is still to do.
To run checks with valgrind, configure with --with-valgrind.
Especially for libnm and libnm-glib tests, there are several leaks
that are (probably?) not the fault of NetworkManager code. Hence,
several suppressions were added to valgrind.suppressions.
On different systems and different version of glib, these suppressions
might not match and the test will fail there.
The valgrind.suppressions should be reviewed, cleaned up and adjusted
for more systems (and different glib library versions).
(cherry picked from commit 2f595aba80)
NMTestDevice does not invoke dispose(), hence it leaks memory which causes
false warnings in testing.
Some minor refactring to let dispose() clear the fields, but free it
later in finalize(). This avoids memleaks in the NMTestDevice stub.
(cherry picked from commit a82d94a64e)
==10501== 353 (32 direct, 321 indirect) bytes in 1 blocks are definitely lost in loss record 1,579 of 1,641
==10501== at 0x7EE3728: g_type_create_instance (gtype.c:1847)
==10501== by 0x7EC75B4: g_object_new_internal (gobject.c:1746)
==10501== by 0x7EC945C: g_object_newv (gobject.c:1890)
==10501== by 0x7EC9C23: g_object_new (gobject.c:1556)
==10501== by 0x1CD87C: nm_setting_wireless_security_new (nm-setting-wireless-security.c:122)
==10501== by 0x16F70B: make_wpa_setting (reader.c:3010)
==10501== by 0x16F33F: make_wireless_security_setting (reader.c:3188)
==10501== by 0x161F4C: wireless_connection_from_ifcfg (reader.c:3464)
==10501== by 0x16109A: connection_from_file_full (reader.c:4763)
==10501== by 0x1614EE: connection_from_file_test (reader.c:4862)
==10501== by 0x13D1D6: test_read_wifi_wpa_psk_unquoted2 (test-ifcfg-rh.c:4316)
==10501== by 0x1281FD: main (test-ifcfg-rh.c:12513)
==10501==
(cherry picked from commit fcfd8f487a)