Commit graph

19456 commits

Author SHA1 Message Date
Thomas Haller
b6b6baa773 libnm: rename "libnm-core/nm-jansson.h" to "libnm-core/nm-json.h"
We already have "shared/nm-utils/nm-jansson.h". Avoid reusing the same file name.
2018-01-16 14:47:24 +01:00
Thomas Haller
950a14128b libnm/trivial: don't use non-leading tabs 2018-01-16 14:47:24 +01:00
Thomas Haller
e5358606ba libnm: merge branch 'th/libnm-vpn-service-shutdown'
https://github.com/NetworkManager/NetworkManager/pull/59
2018-01-16 14:41:39 +01:00
Thomas Haller
e428252935 libnm: add nm_vpn_service_plugin_shutdown() API
Otherwise, the only way to disconnect the NMVpnServicePlugin
instance is by completely unrefing it. However, often it is
not so easy to ensure that nobody else is still keeping the
instance alive, after the point where we no longer want to
handle D-Bus requests. nm_vpn_service_plugin_shutdown() to the
rescue.
2018-01-16 14:39:09 +01:00
Thomas Haller
e89e5edcf8 libnm: cleanup resource handling in NMVpnServicePlugin:init_sync() 2018-01-16 14:38:06 +01:00
Lubomir Rintel
8ba46ff4c6 rpm: disable libnm-glib for Fedora 29 and RHEL 8
While at it, move the API documentation to libnm-devel.
There doesn't seem to be a better place for it.
2018-01-16 12:15:51 +01:00
Lubomir Rintel
bfff3ecfb0 build: don't install NetworkManager.pc when libnm-glib is disabled 2018-01-16 12:15:51 +01:00
Thomas Haller
07d8431ae5 platform: merge branch 'th/wifi-cleanup'
https://github.com/NetworkManager/NetworkManager/pull/58
2018-01-15 20:29:36 +01:00
Thomas Haller
a21a5558b1 platform: move genl functions to nm-netlink.c
So they can be reused outside of wifi, like for implementing
wireguard support.
2018-01-15 20:29:26 +01:00
Thomas Haller
d702581812 platform: move netlink functions to nm-netlink.h 2018-01-15 20:29:26 +01:00
Thomas Haller
9562d88633 platform: add nm-netlink.h for netlink related helper functions
Especially useful, because we don't link against libnl-genl-3.so
but re-implement generic netlink support. Such code should go there
so it can be used by various components.
2018-01-15 20:29:26 +01:00
Thomas Haller
d2292cc649 wifi: remove configure checks for suitable WEXT header
The check doesn't seem useful, because it does not result in a fallback
or a different build.

Just assume <linux/wireless.h> is valid. In case it is not, we will get a
build failure later. That is just as good.
2018-01-15 20:29:26 +01:00
Thomas Haller
cd6116e58f wifi: remove configure checks for suitable linux/nl80211.h header
The check doesn't seem useful, because it does not result in a fallback
or a different build.

Just assume <linux/nl80211.h> is valid. In case it is not, we will get a
build failure later. That is just as good.
2018-01-15 20:29:26 +01:00
Thomas Haller
a3f77b259c wifi: always build nl80211 CRIT_PROTOCOL support
netlink's API is stable, and strictly defined by the integer values that make
up commands and attributes. There is little reason do disable a netlink feature
based on compile time detection of the kernel headers.

Either kernel supports it, or it will fail with an appropriate response.

Also, support for NL80211_CMD_CRIT_PROTOCOL_START was merge to kernel
in 2013. Maybe, we should now just always assume support (in the kernel
headers is there). Anyway, don't do that yet, but instead avoid the
defines and use the numeric values directly.
2018-01-15 20:29:26 +01:00
Thomas Haller
feb1fc2e73 wifi: rework WifiData to use a separate struct for function pointers
Add a WifiDataClass struct, that is immutable and contains all the
function pointers that were previously embedded in WifiData directly.
They are not ever modified after creation, hence this allows to have
a "static const" allocated instance of the VTable.

Also rename wifi_data_deinit() to wifi_data_unref(). It does not only
deinitialize the instance, instead it also frees it. Hence, rename it
to "unref()".
2018-01-15 20:29:26 +01:00
Thomas Haller
3cb81ee063 wifi: cleanup includes
- always include the corresponding header file first after "nm-default.h".
- include all our other headers last.
2018-01-15 20:29:26 +01:00
Thomas Haller
3de3f59ffd platform: fix wrong cleanup function in ip_route_get()
Fixes: 33a2a7c3e3
2018-01-15 20:29:26 +01:00
Francesco Giudici
345d34b369 team: merge branch 'fg/team_sys_prio_default-rh1533810'
https://bugzilla.redhat.com/show_bug.cgi?id=1533810
2018-01-15 18:28:04 +01:00
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