Commit graph

15998 commits

Author SHA1 Message Date
Thomas Haller f9b6042441 build: merge "tools/Makefile.am" into toplevel Makefile 2016-10-19 17:16:08 +02:00
Thomas Haller b4372070a6 build: always enable building of tests
Let's always build with tests, regardless of --enable-tests.

If the user builds with --enable-tests=no, we automake the tests
as check_PROGRAMS, which only compiles the tests during `make check`.

Otherwise, we automake them as noinst_PROGRAMS, which builds the
tests regularly as a normal build.

This way, a user who doesn't want to build the tests regularly,
still can build and run them via `make check`.
2016-10-19 17:16:08 +02:00
Thomas Haller f87d153f8a build: merge "src/settings/plugins/ibft/Makefile.am" into toplevel Makefile 2016-10-19 17:16:08 +02:00
Thomas Haller 541f543451 build: merge "src/settings/plugins/keyfile/Makefile.am" into toplevel Makefile 2016-10-19 17:16:08 +02:00
Thomas Haller 48058ff21f build: merge "src/ppp-manager/Makefile.am" into toplevel Makefile 2016-10-19 17:16:08 +02:00
Thomas Haller 815624bf24 build: merge "src/dhcp-manager/tests/Makefile.am" into toplevel Makefile 2016-10-19 17:16:08 +02:00
Thomas Haller 481d2165e9 build: merge "src/dhcp-manager/Makefile.am" into toplevel Makefile 2016-10-19 17:16:08 +02:00
Thomas Haller b219eb19f1 build: merge "src/Makefile.am" into toplevel Makefile
Had to rename "nm-enum-types.h" because it works badly with
"libnm/nm-enum-types.h". Maybe I could fix that differently,
but duplicate names is anyway error prone.

Note that "nm-core-enum-types.h" is already taken too, so
"nm-src-enum-types.h" it is.
2016-10-19 17:16:08 +02:00
Thomas Haller 7aefbcb622 build: merge "libnm/tests/Makefile.am" into toplevel Makefile 2016-10-19 17:16:08 +02:00
Thomas Haller 9061432d55 build: merge "libnm/Makefile.am" into toplevel Makefile 2016-10-19 17:16:07 +02:00
Thomas Haller 8fdd5dec72 build: merge "libnm-core/tests/Makefile.am" into toplevel Makefile
libnm-core/Makefile.libnm-core still exists, it is used by
libnm/Makefile.am.
2016-10-19 15:26:30 +02:00
Thomas Haller e99978cb54 build: merge "libnm-core/Makefile.am" into toplevel Makefile
libnm-core/Makefile.libnm-core still exists, it is used by
libnm/Makefile.am.

Also, libnm-core/tests/Makefile.am still exists.
2016-10-19 15:26:30 +02:00
Thomas Haller 3c2a49df2f build: merge "introspection/Makefile.am" into toplevel Makefile.am 2016-10-19 15:26:30 +02:00
Thomas Haller cd98705d21 tests: combine "run-test-valgrind.sh" and "run-test-dbus-session.sh" in "run-nm-test.sh"
No need to have two test-runners. Combine them, and call tests always
via "tools/run-nm-test.sh".

Yes, this brings an overhead, that we now always invoke the test with
a test wrapper script, also --without-vagrind. Previously, that was only
necessary for libnm tests that require their own D-Bus session.

Later we will do non-recursive Makefiles, thus all tests should have the
same LOG_COMPILER.
2016-10-19 15:26:30 +02:00
Thomas Haller 274de2555b build/trivial: rename VALGRIND_RULES in Makefile.am to NM_LOG_COMPILER 2016-10-19 15:26:30 +02:00
Thomas Haller a54a3e8263 tools/trivial: replace tabs from "tools/run-test-valgrind.sh" script 2016-10-19 15:26:30 +02:00
Thomas Haller 491aad08a9 contrib/rpm: run make check in parallel (again)
Revert commit f551c91d33 and restore
parallel `make check`. It should work.
2016-10-19 15:26:30 +02:00
Thomas Haller c94dac0b5d tools: fix starting tests with D-Bus session with NMTST_NO_VALGRIND=1
When running

  NMTST_NO_VALGRIND=1 make check -j

we would not start separate D-Bus sessions, thus running tests with
valgrind enabled failed.
2016-10-19 15:26:30 +02:00
Thomas Haller 5424e3a063 keyfile: disable permission checks of keyfile for tests
The tests were checking that the keyfiles had permission
0600 and there was a check-local target to prepare the permissons
of the tests.

That is inconvenient, and it is unexpected to have a check-local
target for such a case.

Also, the tests were not testing that keyfile reader would
bail out on invalid permissions. So just skip the check for
testing.
2016-10-19 15:26:30 +02:00
Thomas Haller 068dd41df9 platform/tests: relax assertion in software_add
Avoid failure

    NMPlatformSignalAssert: test-link.c:146, software_add(): failure to accept signal one time: link-changed-changed ifindex 15 (2 times received)
2016-10-19 15:23:49 +02:00
Beniamino Galvani 956f0be2f9 platform: fix lifetime check 2016-10-18 16:48:27 +02:00
Beniamino Galvani 628cc8a057 arping: fix error handling when starting probe
We didn't check the return value of g_spawn_async() and added a watch
on a potentially zero pid.
2016-10-18 16:48:27 +02:00
Thomas Haller 34f3563add tools: dist "tools/create-exports-NetworkManager.sh"
It's also used by contrib/rpm's SPEC file.
2016-10-17 16:21:08 +02:00
Lubomir Rintel 2c43862b2d platform/tests: don't attempt to mount anything to /sys/devices
More recent kernels won't allow that in userns when /sys itself
is read-only.
2016-10-17 15:45:59 +02:00
Lubomir Rintel 0acdcc348c Revert "platform/tests: skip root tests when we can't mount /sys/devices"
This was plain stupid. We don't care about sysfs being writable or
anything *before* entering the namespace.

This reverts commit 15a26d6192.
2016-10-17 15:45:59 +02:00
Beniamino Galvani acb69cda0c merge: branch 'bg/autoconnect-retries-bgo763524'
https://bugzilla.gnome.org/show_bug.cgi?id=763524
2016-10-16 12:56:39 +02:00
Beniamino Galvani a67bdbc331 core: handle the autoconnect-retries property 2016-10-16 12:56:09 +02:00
Beniamino Galvani 2a93d44a7a cli: support the autoconnect-retries property 2016-10-16 12:56:09 +02:00
Beniamino Galvani f63e28b147 ifcfg-rh: support the autoconnect-retries property 2016-10-16 12:56:09 +02:00
Beniamino Galvani 51d7a18f2e libnm-core: introduce connection.autoconnect-retries property
While technically it's already possible to implement a fail-over
mechanism using multiple connections (for example, defining a higher
priority DHCP connection with short DHCP timeout and a lower priority
one with static address), in practice this doesn't work well as we try
to autoactivate each connection 4 times before switching to the next
one.

Introduce a connection.autoconnect-retries property that can be used
to change the number of retries. The special value 0 means infinite
and can be used to try the connection forever. A -1 value means the
global configured default, which is equal to 4 unless overridden.

https://bugzilla.gnome.org/show_bug.cgi?id=763524
2016-10-16 10:08:13 +02:00
Beniamino Galvani 92a8cfac69 core: introduce default logging macros 2016-10-14 15:57:43 +02:00
Thomas Haller f551c91d33 Revert "contrib/rpm: run make check in parallel"
`make check -C libnm/tests` is not yet ready to run in
parallel. Revert.

This reverts commit 0a1508358d.
2016-10-14 15:48:27 +02:00
Thomas Haller 5ea3196376 contrib/rpm: rename obsoletes_nmver to obsoletes_version_device_plugins
We will have multiple obsoletes
2016-10-14 11:26:13 +02:00
Beniamino Galvani d7b32008b7 merge: branch 'bg/platform-unaligned-stats64-bgo772605'
https://bugzilla.gnome.org/show_bug.cgi?id=772605
2016-10-14 11:16:42 +02:00
Beniamino Galvani 89bcf50f61 platform: avoid unaligned access to link stats on 64bit architectures
The undefined behavior sanitizer complains with:

platform/nm-linux-platform.c:1482:31: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^
platform/nm-linux-platform.c:1483:29: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^
platform/nm-linux-platform.c:1484:31: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^
platform/nm-linux-platform.c:1485:29: runtime error: member access within misaligned address 0x61a000016fac for type 'struct rtnl_link_stats64', which requires 8 byte alignment
0x61a000016fac: note: pointer points here
  bc 00 17 00 bf 05 00 00  00 00 00 00 bf 05 00 00  00 00 00 00 b5 68 02 00  00 00 00 00 b5 68 02 00
              ^

That's because the pointer returned by nla_data() is only
32bit-aligned and using it to access structure members can cause
issues on some 64bit architectures.

Use the unaligned_read_ne64() macro to access the structure members.

https://bugzilla.gnome.org/show_bug.cgi?id=772605
2016-10-14 11:16:13 +02:00
Beniamino Galvani 22cc119da5 shared: add unaligned.h
The file, imported from systemd sources, contains macros for accessing
potentially unaligned data in a safe way (i.e. byte-wise).
2016-10-14 11:16:13 +02:00
Beniamino Galvani c95a3a28ac build: don't remove shared/nm-version-macros.h upon clean
Files generated by ./configure shouldn't be deleted by a 'make clean'.

Fixes: 24f566afa0
2016-10-14 10:59:54 +02:00
Beniamino Galvani 0a61317870 libnm: disconnect devices' signals when disposing manager
We connect signal handlers to devices when they appear, but don't
disconnect the handlers when the manager instance is destroyed. This
can cause crashes as device_ac_changed() is called on an invalid
manager instance.

Disconnect the handlers from dispose().

https://bugzilla.redhat.com/show_bug.cgi?id=1383758
2016-10-14 10:44:18 +02:00
Thomas Haller c4325f6494 contrib/rpm: force compilation with "--enable-ld-gc"
It should already be autodetected. Just be explicit about it.
2016-10-14 10:33:30 +02:00
Thomas Haller 0a1508358d contrib/rpm: run make check in parallel 2016-10-14 10:33:30 +02:00
Thomas Haller cf678811b5 contrib/rpm: regenerate the linker version script NetworkManager.ver while building the package 2016-10-14 10:33:30 +02:00
Thomas Haller c7853a1415 build: add extra dependencies for linker-version-script for NetworkManager and libnm.so 2016-10-14 10:33:30 +02:00
Beniamino Galvani 185f008521 libnm-core: fix documentation comments
../libnm-core/nm-utils.c:4405: Warning: NM: nm_utils_is_json_object: unknown parameter 'str' in documentation comment, should be 'json'
../libnm-core/nm-connection.c:2208: Warning: NM: nm_connection_get_setting_proxy: return value: Missing (transfer) annotation
2016-10-14 10:05:54 +02:00
Thomas Haller 54f701b95c contrib/rpm: fix build_clean.sh --quick after removing shared/Makefile.am
Fixes: 24f566afa0
2016-10-14 10:02:46 +02:00
Beniamino Galvani 0539725aef supplicant: fix cancellation of interface association
The @assoc_cancellable was never initialized and thus ineffective; fix
this.

Furthermore, we only cancel it in nm_supplicant_interface_disconnect()
as we expect that clients call the function before destroying the
interface. Don't assume this and also cancel it in dispose().

https://bugzilla.redhat.com/show_bug.cgi?id=1383628
2016-10-14 09:32:48 +02:00
Thomas Haller c23eb7043f dns/resolved: merge branch 'dns-resolved-add-domain'
https://bugzilla.gnome.org/show_bug.cgi?id=772343
2016-10-14 06:19:03 +02:00
Thomas Haller 510626bf74 ip-config: cleanup integer types for nm_ip4_config_get_num_*() 2016-10-14 06:18:43 +02:00
Thomas Haller 5253ab0d0d dns/resolved: don't repeatedly call nm_ip4_config_get_num_*() to iterate config 2016-10-14 06:09:11 +02:00
Thomas Haller 878ed77c6b dns/resolved: fix style issues 2016-10-14 05:55:31 +02:00
Sjoerd Simons c4864ba63f dns/resolved: adjust link domain settings
Make link domain settings more conventional. If an IP Config only has no
search entries, use domains for search instead otherwise ignore domains.

Also on connections which are never the default, setup the
search/domains as routing-only meaning that only dns queries for those
domains will be done on this link. Prevents quering DNS information for
on-vpn host with other namservers and using the VPN DNS server for host
not on the VPN.

This is also fixes issues with a recent change in systemd-resolved where
links with a routing domain will only be used for those domains, which
meant that the previous strategry with a typical ip configuration (no
search only domains) resulted in no usable name resolution.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=772343
2016-10-14 05:40:53 +02:00