Commit Graph

17169 Commits

Author SHA1 Message Date
Thomas Haller
be822292d8 build: remove long gone libndp submodule from configure.ac 2016-10-24 12:01:54 +02:00
Thomas Haller
8cca81bbb0 libnm: merge branch 'th/libnm-no-empty-string-properties-rh1380424'
https://bugzilla.redhat.com/show_bug.cgi?id=1380424
2016-10-24 10:14:02 +02:00
Thomas Haller
95ab69b761 libnm: coerce empty strings to NULL for D-Bus properties
On D-Bus level, string (s) or object paths (o) cannot be NULL.
Thus, whenver server exposes such an object, it gets automatically
coerced to "" or "/", respectively.

On client side, libnm should coerce certain properties back, for which
"" is just not a sensible value.

For example, an empty NM_DEVICE_ETHERNET_HW_ADDRESS should be instead
exposed as NULL.

Technically, this is an API change. However, all users were well advised
to expect both NULL and "" as possible return values and handle them
accordingly.
2016-10-24 10:14:02 +02:00
Thomas Haller
21d7aa9204 libnm: minor refactoring by using g_clear_object() and nm_str_not_empty() 2016-10-24 10:14:02 +02:00
Thomas Haller
c4198d45e3 libnm: avoid possibly NULL address for NMDeviceVlan calling nm_utils_hwaddr_matches() 2016-10-24 10:14:02 +02:00
Thomas Haller
7eb054d099 libnm: fix memleak in NMDeviceVxlan 2016-10-24 10:14:02 +02:00
Thomas Haller
16a6991b90 team: minor cleanup handling empty team config 2016-10-24 10:14:02 +02:00
Thomas Haller
34970e4141 shared: make nm_str_not_empty() inline function instead of macro
It was a macro to pass on the non-const-ness of the argument, but
that just doesn't make sense.

That is a signature

  char *nm_str_not_empty (char *)

does not make sense, because you cannot transfer ownership
conditionally without additional checks to avoid a leak. Which makes
this form is pointless. For example:

    char *
    foo (void)
    {
        char *s;

        s = _create_value ();
        return nm_str_not_empty (s); /* leaks "" */
    }
2016-10-24 10:14:02 +02:00
Beniamino Galvani
ddeef464af checkpoint: introduce new flags to better restore previous state
When a global checkpoint is created (one with empty device list) we
save the status of all devices to restore it later. After the
checkpoint new interfaces and connections may appear and they can
significantly influence the overall networking status, but we don't
consider them at the moment.

Introduce a new flag DELETE_NEW_CONNECTIONS to delete any connection
added after the checkpoint and similarly a DISCONNECT_NEW_DEVICES to
ensure that the connection active on newly appeared devices doesn't
disrupt network connectivity.

https://bugzilla.redhat.com/show_bug.cgi?id=1378393
2016-10-24 09:57:18 +02:00
Thomas Haller
a5e3016fc9 man: document /var/run/NetworkManager/conf.d directory 2016-10-23 13:33:09 +02:00
Thomas Haller
b8b47babd2 config: avoid conflicts of /run config dir with other directories
The user can configure the configuration paths via command line
arguments. If the user configures /var/run/NetworkManager/conf.d
as --system-config-dir or --config-dir, avoid using it as run-config
directory.

Yes, this doesn't catch

  NetworkManager --config-dir=/etc/NetworkManager/conf.d \
          --system-config-dir=/etc/NetworkManager/conf.d/
2016-10-23 12:52:01 +02:00
Thomas Haller
3248b387a2 config: merge branch 'th/run-conf.d-bgo773069'
https://bugzilla.gnome.org/show_bug.cgi?id=773069
2016-10-23 11:42:51 +02:00
Thomas Haller
4b965d0cf6 build: exclude building src/platform/tests/monitor for --enable-tests=no
src/platform/tests/monitor is more a test-program. If should not
be compiled in a non-test build.
2016-10-23 10:52:57 +02:00
Thomas Haller
b5aec6b7e7 config: cleanup ownership handling of @keyfile in read_entire_config() 2016-10-23 10:52:57 +02:00
Thomas Haller
f8c4a33f25 config: add run-configs to description string 2016-10-23 10:52:57 +02:00
Martin Pitt
49fcfcdfae config: skip shadowed run-config files in read_entire_config()
https://bugzilla.gnome.org/show_bug.cgi?id=773069
2016-10-23 10:52:57 +02:00
Mathieu Trudel-Lapierre
feff60ef3e config: read /run/NetworkManager/conf.d files
This is useful for configuration that gets auto-generated from another source.
These are then not primary configuration files and thus should not be put into
/etc.

This mirrors the structure of udev rules or systemd units, which can also be in
/usr, /run/, or /etc/.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>

https://bugzilla.gnome.org/show_bug.cgi?id=773069
2016-10-23 10:52:57 +02:00
Thomas Haller
9cb2bbe658 build: merge branch 'th/build-cleanup'
Some cleanup of the toplevel Makefile.am.

The aim it to build every source file only once. That saves compilation
time, but more importantly it guarantees that there are no differing CFLAGS
and all users use exactly the same binary.
2016-10-22 17:56:32 +02:00
Thomas Haller
5cb60e7099 build: combine CPPFLAGS for src/tests 2016-10-22 17:55:44 +02:00
Thomas Haller
7b73951b1b build: buld nm-dhcp-manager.c as part of libNetworkMangerBase
NetworkManager and nm-iface-helper compiled nm-dhcp-manager.c twice,
the latter with setting -DNM_DHCP_INTERNAL_ONLY to only enable the
internal plugin.

Change that to compile nm-dhcp-manager.c once for both users
by putting it into libNetworkManagerBase.
2016-10-22 17:55:15 +02:00
Thomas Haller
f9bd72c337 build: build src/platform/tests/test-common.c as part of libNetworkManagerTest.la
Instead having a base test-library libNetworkManagerTest.la and a separate
libnm-platform-tests.la, merge them together.
2016-10-22 17:16:17 +02:00
Thomas Haller
58916ff30a build: refactor intermediate NetworkManager libraries during build
nm-iface-helper re-compiled a number of source files that are already
compiled for NetworkManager. Prepare those files as libNetworkManagerBase.la.
2016-10-22 17:16:17 +02:00
Thomas Haller
002f17c25d src: drop generated nm-src-enum-types.h
We only needed proper glib enum types for having properties
and signal arguments. These got all converted to plain int,
so no longer generate such an enum type.
2016-10-22 17:16:17 +02:00
Thomas Haller
3bbc55fd9c core: don't use generated glib enum for platform types 2016-10-22 17:16:17 +02:00
Thomas Haller
931a5b4f1c core: don't use generated glib enum for NMAuthSubjectType 2016-10-22 17:16:17 +02:00
Thomas Haller
5657d4dffb build: reuse common CPPFLAGS via dflt_cppflags_libnm_core variable 2016-10-22 17:16:17 +02:00
Thomas Haller
f5c5dba4f5 build: don't link libnm-wwan.la against introspection/libnmdbus.la
Also, the $(top_builddir) was wrong.
2016-10-22 17:15:50 +02:00
Thomas Haller
6375c54679 travis: build additional settings plugin in travis-ci
Although the build environment is Ubuntu, we still can build the
non-native settings plugins to test the build.
2016-10-22 17:15:50 +02:00
Thomas Haller
4450215ad1 build: fix out-of-tree build for libnm-core/tests 2016-10-22 17:12:06 +02:00
Thomas Haller
548a5440e9 ifcfg-rh: fix signature of link_changed() callback
Depending on how arguments are passed to the called function,
this could lead to a crash.

Maybe not on 32 bit machines where the size of the pointer is
the size of an int.

Maybe not on x86_64, where the arguments are passed in registers.

Fixes: b88c309167
2016-10-22 16:12:58 +02:00
Thomas Haller
9f11610606 build: fix out-of-tree build for dispatcher 2016-10-22 16:12:46 +02:00
Thomas Haller
75f29b8a9c build: fix out-of-tree build for libnm/tests/libnm-vpnplugin-utils-test.la 2016-10-22 16:07:46 +02:00
Thomas Haller
67cc67ce46 build: merge branch 'th/non-recursive-make-bgo772985'
https://bugzilla.gnome.org/show_bug.cgi?id=772985
2016-10-21 19:17:27 +02:00
Thomas Haller
6c90b529a1 build: fix make always re-making vapigen target
Reproduce:

  make
  touch libnm-util/NetworkManager-1.0.gir
  make
  make
  # rebuilds "VAPIGEN vapi/libnm-util.vapi" every time.

  ls -la libnm-util/NetworkManager-1.0.gir vapi/libnm-util.vapi
  # note that vapi/libnm-util.vapi was not touched.

See-also: https://git.gnome.org/browse/vala/tree/ccode/valaccodewriter.vala?id=f52b484954d3297ae4c3230fbe969db18eb08841#n117
See-also: https://bugzilla.gnome.org/show_bug.cgi?id=773325
2016-10-21 18:46:03 +02:00
Thomas Haller
351851cf27 build: merge "examples/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
b648772fc4 build: merge "examples/C/qt/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
742d36c476 build: merge "examples/C/glib/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
14b5309af3 build: merge "vapi/Makefile.am" into toplevel Makefile
There is an strange automake warning

    Makefile.vapigen:49: warning: $(1) was already defined in condition TRUE, which includes condition ENABLE_VAPIGEN ...
    Makefile.am:4:   'Makefile.vapigen' included from here
    Makefile.glib:124: ... '$(1)' previously defined here
    Makefile.am:1:   'Makefile.glib' included from here

when having

    if ENABLE_VAPIGEN
    include Makefile.vapigen
    endif

That is worked around by removing the "if", which however
requires us to remove the error check in Makefile.vapigen.
2016-10-21 17:37:57 +02:00
Thomas Haller
b0f4e25782 build: merge "docs/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
03e88d92a6 build: move nm.mk into main Makefile.am 2016-10-21 17:37:57 +02:00
Thomas Haller
2296db22c8 build: merge "man/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
0f09b1d1cc build: merge "libnm-glib/tests/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
8027e09be4 build: merge "libnm-glib/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
7c66a6be17 build: merge "libnm-util/tests/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
fa0acb2042 build: merge "libnm-util/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
8fa3314736 build: merge "data/Makefile.am" into toplevel Makefile 2016-10-21 17:37:57 +02:00
Thomas Haller
586e830e05 build: merge "clients/tui/Makefile.am" into toplevel Makefile 2016-10-21 17:37:56 +02:00
Thomas Haller
2238ccb48b travis: run tests in parallel 2016-10-21 17:37:56 +02:00
Thomas Haller
c8a25001f4 build: merge "clients/cli/Makefile.am" into toplevel Makefile 2016-10-21 17:37:56 +02:00
Thomas Haller
f63a5a2a0d build: merge "clients/Makefile.am" into toplevel Makefile 2016-10-21 17:37:56 +02:00