Commit Graph

21088 Commits

Author SHA1 Message Date
Francesco Giudici
2c99eba42f libnm-core: team: fix runner sys_prio default value 2018-01-15 18:27:10 +01:00
Francesco Giudici
c6448f724b cli: get team defaults from setting header files
this allows centralizing default values definition and allows quicker
and safer update of default values.
2018-01-15 18:27:10 +01:00
Thomas Haller
929f36c56f libnm/vpn: unexport and destroy D-Bus glue instance with NMVpnServicePlugin
Otherwise, we might still be called back with D-Bus requests, after
the NMVpnServicePlugin instance is already destroyed.
2018-01-15 13:30:36 +01:00
Francesco Giudici
1cf1843f9c libnm-core: docs update requires also settings-docs.h.in update
Fixes: 112f8bd5af
2018-01-12 15:13:48 +01:00
Thomas Haller
aa9b8049ed core/trivial: fix whitespace 2018-01-12 14:50:53 +01:00
Francesco Giudici
112f8bd5af libnm-core: update team.runner description
https://bugzilla.redhat.com/show_bug.cgi?id=1533799
2018-01-12 14:22:43 +01:00
Beniamino Galvani
b2f306ac3d dns: merge branch 'bg/dns-domains-pt1-bgo746422'
https://bugzilla.gnome.org/show_bug.cgi?id=746422
2018-01-12 13:43:51 +01:00
Beniamino Galvani
e91f1a7d2a dns: introduce routing domains
Similarly to what systemd-resolved does, introduce the concept of
"routing" domain, which is a domain in the search list that is used
only to decide the interface over which a query must be forwarded, but
is not used to complete unqualified host names. Routing domains are
those starting with a tilde ('~') before the actual domain name.

Domains without the initial tilde are used both for completing
unqualified names and for the routing decision.
2018-01-12 13:42:08 +01:00
Beniamino Galvani
42ea86fb7a dns: systemd-resolved: use generic ip-config functions 2018-01-12 13:42:08 +01:00
Beniamino Galvani
70550e2740 dns: export search list in the D-Bus "domain" attribute
The "domain" key of the D-Bus configuration dictionary specifies the
domains a configuration applies to. In DNS code we consider domains
and searches as equivalent, so they should be exported via D-Bus using
the same logic used to populate resolv.conf and for plugins.
2018-01-12 13:42:08 +01:00
Beniamino Galvani
b4db0e8362 dns: add @dup argument to add_dns_domains() and add_string_item()
Add a @dup argument that tells whether the new item should be
duplicated.
2018-01-12 13:42:08 +01:00
Beniamino Galvani
e78bfb63cd dns: split out domains retrieval 2018-01-12 13:42:08 +01:00
Thomas Haller
d3dfadf639 build/meson: merge branch 'meson-fixes'
https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00055.html
2018-01-12 09:54:52 +01:00
Thomas Haller
be13c75a3c po: skip translation for file in meson build directory
Otherwise, having a meson build directory along autotools,
lets `make check` fail with

    The following files contain translations and are currently not in use. Please
    consider adding these to the POTFILES.in file, located in the po/ directory.

    build/data/org.freedesktop.NetworkManager.policy.in

    If some of these files are left out on purpose then please add them to
    POTFILES.skip instead of POTFILES.in. A file 'missing' containing this list
    of left out files has been written in the current directory.
    Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager
    if [ -r missing -o -r notexist ]; then \
      exit 1; \
    fi

Yes, meson does not require that the build directory is named "build"
and this fix only works for the default case.
2018-01-12 09:51:12 +01:00
Thomas Haller
2f85fe0adf gitignore: ignore generated clients/common/settings-docs.h file 2018-01-12 09:51:12 +01:00
Iñigo Martínez
7b34c3cf3e build: Rename settings-docs.c file
The `settings-docs.c` file is generated by processing the
`nm-property-docs.xml` file. Although this works in autotools,
the `.c` extension makes meson not to handle it properly.

Given the fact that it only contains a number of defines it
makes sense to change its extension to `.h` an use it as a header.
This also makes meson to handle it properly and build it before
its used.

https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00057.html
2018-01-12 09:39:06 +01:00
Iñigo Martínez
54641388f8 meson: Fix missing symbols in libnm-glib
The following symbols are missing from the libnm-glib library:

* libnm_glib_get_network_state
* libnm_glib_init
* libnm_glib_register_callback
* libnm_glib_shutdown
* libnm_glib_unregister_callback

This has been changed by linking `libdeprecated_nm_glib` as a whole.

https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00056.html
2018-01-12 09:37:55 +01:00
Iñigo Martínez
4fc4c16092 meson: Slightly simplify jansson soname retrieval
The process for retrieving jansson's soname has been slightly
simplified.

https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00054.html
2018-01-12 09:35:55 +01:00
Thomas Haller
34cb6f9877 build/meson: use variables for ldflags and linker-script 2018-01-11 12:46:01 +01:00
Thomas Haller
98b46537fa build/meson: remove unnecessary square brackets 2018-01-11 12:29:31 +01:00
Lubomir Rintel
603daa5b25 secret-agent: construct the dbus proxy for async agent with the correct bus name
The asynchronous secret agent initialization doesn't work at all due to a
rather silly typo. Oops.

While at it, fix a whitespace error too.
2018-01-11 11:52:40 +01:00
Thomas Haller
b214d148f4 build: fix type on Makefile.am which breaks build
Fixes: 97f06c3a6d
2018-01-10 16:49:44 +01:00
Beniamino Galvani
3d4652fc6e ppp: merge branch 'bg/ppp-set-ifindex-bgo1515829'
https://bugzilla.redhat.com/show_bug.cgi?id=1515829
2018-01-10 15:36:38 +01:00
Beniamino Galvani
398f9105b4 ppp: update interface name in the plugin after NM changes it
When NM knows of the ifindex/name of the new PPP interface (through
the SetIfindex() call), it renames it. This can race with the pppd
daemon, which issues ioctl() using the interface name cached in the
global 'ifname' variable:

  ...
  NetworkManager[27213]: <debug> [1515427406.0036] ppp-manager: set-ifindex 71
  pppd[27801]: sent [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
  NetworkManager[27213]: <debug> [1515427406.0036] platform: link: setting 'ppp5' (71) name dsl-ppp
  pppd[27801]: sent [IPCP ConfAck id=0x2 <addr 3.1.1.1>]
  pppd[27801]: ioctl(SIOCSIFADDR): No such device (line 2473)
  pppd[27801]: Interface configuration failed
  pppd[27801]: Couldn't get PPP statistics: No such device
  ...

Fortunately the variable is exposed to plugins and so we can turn the
SetIfindex() D-Bus call into a synchronous one and then update the
value of the 'ifname' global variable with the new interface name
assigned by NM.
2018-01-10 15:36:29 +01:00
Beniamino Galvani
41ef5853e6 ppp/trivial: rename field 2018-01-10 15:36:29 +01:00
Beniamino Galvani
dd98ada33f ppp: introduce SetIfindex pppd plugin D-Bus method
If IPV6CP terminates before IPCP, pppd enters the RUNNING phase and we
start IP configuration without having an IP interface set, which
triggers assertions.

Instead, add a SetIfindex() D-Bus method that gets called by the
plugin when pppd becomes RUNNING. The method sets the IP ifindex of
the device and starts IP configuration.

https://bugzilla.redhat.com/show_bug.cgi?id=1515829
2018-01-10 15:36:29 +01:00
Beniamino Galvani
2507046fea device: add nm_device_set_ip_ifindex() 2018-01-10 15:36:29 +01:00
Thomas Haller
1712fae6e8 build: merge branch 'th/build-meson-on-travis'
https://github.com/NetworkManager/NetworkManager/pull/54
2018-01-10 15:33:12 +01:00
Thomas Haller
4bf77ea810 travis: enable matrix build for gcc/clang and autotools/meson 2018-01-10 12:31:44 +01:00
Thomas Haller
58299703a2 travis: add meson builds to travis-ci 2018-01-10 12:31:44 +01:00
Thomas Haller
349861ceec build/meson: unconditionally use linker version scripts
We also unconditionally use them with autotools.
Also, the detection for have_version_script does
not seem correct to me. At least, it didn't work
with clang.
2018-01-10 12:31:44 +01:00
Thomas Haller
ec016f6b43 build/meson: fix build without have_version_script
We always need to declare the linker_script_* variables, because they
are used (unconditionally) as a dependency, even without have_version_script.
2018-01-10 12:30:48 +01:00
Thomas Haller
3d7aa8483e build/meson: disable unit tests that are known to fail
I think it's because meson doesn't run the tests in their
own D-Bus session, hence the use the system service.

automake solves this running all tests via ./tools/run-nm-test.sh,
which knows how to prepare a suitable environment for the tests.
2018-01-10 12:30:48 +01:00
Thomas Haller
796df704a7 build/meson: fix build without introspection
nm_settings_docs is only defined with enable_introspection.
2018-01-10 12:30:48 +01:00
Thomas Haller
32e989b5a7 build/meson: fix gir dependency with building without fake-typelibs 2018-01-10 12:30:48 +01:00
Thomas Haller
2ad6976cd4 build/meson: fix build with -D session_tracking=no -D systemdsystemunitdir=no
The variable enable_consolekit is used below, outside the if.
We always must set it.
2018-01-10 12:27:33 +01:00
Thomas Haller
ca9418232c build/meson: rename config_plugin_ibft option to just ibft 2018-01-10 12:27:33 +01:00
Thomas Haller
619de16f3c build/meson: meson improvements
https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00039.html
https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00046.html
2018-01-10 12:24:24 +01:00
Iñigo Martínez
50930ed19a meson: Use string variables extensively
The strings holding the names used for libraries have also been
moved to different variables. This way they would be less error
as these variables can be reused easily and any typing error
would be quickly detected.
2018-01-10 12:22:55 +01:00
Iñigo Martínez
5e16bcf268 meson: Improve dependency system
Some targets are missing dependencies on some generated sources in
the meson port. These makes the build to fail due to missing source
files on a highly parallelized build.

These dependencies have been resolved by taking advantage of meson's
internal dependencies which can be used to pass source files,
include directories, libraries and compiler flags.

One of such internal dependencies called `core_dep` was already in
use. However, in order to avoid any confusion with another new
internal dependency called `nm_core_dep`, which is used to include
directories and source files from the `libnm-core` directory, the
`core_dep` dependency has been renamed to `nm_dep`.

These changes have allowed minimizing the build details which are
inherited by using those dependencies. The parallelized build has
also been improved.
2018-01-10 12:20:17 +01:00
Thomas Haller
96658d2fd1 all: merge branch 'th/pr/53' (part 1)
Partly merge pull request #52.

https://github.com/NetworkManager/NetworkManager/pull/52
2018-01-10 11:05:00 +01:00
Pavel Šimerda
681d2bcd70 device: split per-directory factory function
In some cases we might want to load device plugins from multiple
directories. A special case that I have in mind is to load plugins from
build directory subdirectories in order to run NetworkManager from the
build directory.

[thaller@redhat.com: modify original patch]
2018-01-10 11:01:46 +01:00
Pavel Šimerda
a967a5be10 build: print missing configured directories
Many of the configured directories default to being defined using existing
directory configuration. As a result you usually don't see the actual
directories that will be used. With the added directories you can at least
assemble the information and thus see which directories will be used.
2018-01-10 11:01:46 +01:00
Iñigo Martínez
97f06c3a6d build: Add meson build files to distributable files
Although it is possible to generate distributable files on meson
since version 0.41 by using the `ninja dist` command, autotools does
different things that end up creating a different distributable
file.

meson build files have been added to autotools build files as
distributable files, so the whole meson port would also be
distributed.

https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00047.html
2018-01-10 06:27:50 +01:00
Thomas Haller
0e1fb1dbd2 dhcp: fix check for client-id in _set_client_id()
Fixes: 686afe531a
2018-01-09 15:55:43 +01:00
Thomas Haller
5eea9be983 all: merge branch 'th/policy-and-mdns'
https://github.com/NetworkManager/NetworkManager/pull/44
2018-01-09 14:25:08 +01:00
Thomas Haller
d1de905ed3 policy: merge IPv4 and IPv6 versions of device_ip_config_changed() 2018-01-09 14:24:54 +01:00
Thomas Haller
c03a534963 core: implement setting MDNS setting for systemd
The connection.mdns setting is a per-connection setting,
so one might expect that one activated device can only have
one MDNS setting at a time.

However, with certain VPN plugins (those that don't have their
own IP interface, like libreswan), the VPN configuration is merged
into the configuration of the device. So, in this case, there
might be multiple settings for one device that must be merged.

We already have a mechanism for that. It's NMIP4Config. Let NMIP4Config
track this piece of information. Although, stricitly speaking this
is not tied to IPv4, the alternative would be to introduce a new
object to track such data, which would be a tremendous effort
and more complicated then this.

Luckily, NMDnsManager and NMDnsPlugin are already equipped to
handle multiple NMIPConfig instances per device (IPv4 vs. IPv6,
and Device vs. VPN).

Also make "connection.mdns" configurable via global defaults in
NetworkManager.conf.
2018-01-09 14:24:54 +01:00
Thomas Haller
b40729ca5f core: rework tracking config in dns-manager to use ifindex
Don't track the per-device configuration in NMDnsManager by
the ifname, but by the ifindex. We should consistently treat
the ifindex as the ID of a link, like kernel does.

At the few places where we actually need the ifname, resolve
it by looking into the platform cache. That is not necessarily
the same as the ifname that is currently tracked by NMDevice,
because netdev interfaces can be renamed, and NMDevice updates
it's link properties delayed. However, the platform cache has
the most recent notion of the correct interface name for an
ifindex, so if we ever hit a race here, we do it now more
correctly.

This also temporarily drops support for mdns. Will be re-added next,
but differently.
2018-01-09 14:24:54 +01:00
Thomas Haller
fc40d91b97 core/trivial: rename local variable in merge_one_ip_config()
Next commit will unify naming of variables, do a trivial rename
first to make the diff smaller.
2018-01-09 14:24:54 +01:00