Commit Graph

24195 Commits

Author SHA1 Message Date
Beniamino Galvani
8cd8a5fbed wifi: allow reapply when the seen-bssids property changed
wifi.seen-bssid is a synthetic read-only property that lists all the
bssids seen for that connection; it should be ignored during a
reapply.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/243
2019-09-13 14:26:21 +02:00
Francesco Giudici
15035e2b0d meson: fix build_clean.sh -w meson -w test
Fixes: 6e5385a4eb ('wwan/tests: test service-providers.xml parser')
2019-09-13 12:59:03 +02:00
Robert Ancell
41593d0787 libnm: Add missing autoptr macros for classes
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/270
2019-09-13 12:15:01 +02:00
Lubomir Rintel
4af856a71b build: make test-service-providers depend on nm-core-enum-types.h
Fixes build:

  In file included from ../src/devices/wwan/nm-service-providers.c:10:
  In file included from ../shared/nm-default.h:279:
  ../libnm-core/nm-core-types.h:14:10: fatal error: 'nm-core-enum-types.h' file not found
  #include "nm-core-enum-types.h"
           ^
  1 error generated.
  make[2]: *** [src/devices/wwan/src_devices_wwan_tests_test_service_providers-nm-service-providers.o] Error 1
2019-09-11 16:42:59 +02:00
Lubomir Rintel
455f6dcbdc build/debian: install mobile-broadband-provider-info 2019-09-11 14:54:34 +02:00
Lubomir Rintel
beab85520a merge: branch 'lr/gsm-default-apn'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/98
2019-09-11 14:34:48 +02:00
Lubomir Rintel
7c53930ceb wwan/modem-broadband: add capability to look up default APN/username/password
This allows the GSM connection to Just Work most of the time, as in:
"nmcli d connect ttyUSB0".
2019-09-11 14:32:05 +02:00
Lubomir Rintel
0d44b640fc wwan/modem-broadband: get rid of g_assert*()
Though there is no known way to reach these, it may well happen that
this is going to prevent some hard crashes.
2019-09-11 14:32:05 +02:00
Lubomir Rintel
6e5385a4eb wwan/tests: test service-providers.xml parser
Just a handful of unit tests.
2019-09-11 14:32:05 +02:00
Lubomir Rintel
6632c77094 wwan: add service-providers.xml parser
This allows up to look up a default APN if the user doesn't pick one.
2019-09-11 14:32:05 +02:00
Thomas Haller
adf0254369 setting-gsm: allow empty apn property in verify()
NetworkManager treats "gsm.apn" %NULL as setting an empty APN ("").
At least with ModemManager. With oFono, a %NULL APN means not to set
the "AccessPointName", so oFono implementation treats %NULL different
from "".

Soon the meaning will change to allow %NULL to automatically
obtain the APN from the mobile-broadband-provider-info. That will be a
change in behavior how to treat %NULL.

Anyway, since %NULL is accepted and in fact means to actually use "",
the empty word should be also accepted to explicitly choose this
behavior. This is especially important in combination with changing the
meaning of %NULL.
2019-09-11 14:32:05 +02:00
Thomas Haller
b92193236a setting-gsm: use size_t variable for strlen() result 2019-09-11 14:32:05 +02:00
Lubomir Rintel
0eb4a5dfa7 setting-gsm: add auto-config property
This will make NetworkManager look up APN, username, and password in the
Mobile Broadband Provider database.

It is mutually exclusive with the apn, username and password properties.
If that is the case, the connection will be normalized to
auto-config=false. This makes it convenient for the user to turn off the
automatism by just setting the apn.
2019-09-11 14:32:05 +02:00
Lubomir Rintel
c3012c1de6 core/connection: drop some unused parameters 2019-09-11 14:32:05 +02:00
Lubomir Rintel
5730b0ff46 wwan: remove an accidentally committed file
Fixes: 7a72c705ac ('initrd: add devicetree support')
2019-09-11 14:24:45 +02:00
Lubomir Rintel
b1f7f431e6 contrib/modemu: also clean up on SIGTERM 2019-09-10 14:33:38 +02:00
Lubomir Rintel
986947dbf5 initrd: fix dt test 2019-09-10 14:11:16 +02:00
Lubomir Rintel
dfcef91410 merge: branch 'lr/licensing'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/264
2019-09-10 11:21:15 +02:00
Lubomir Rintel
ae6668ae85 contrib/checkpatch: fix the systemd code path 2019-09-10 11:20:03 +02:00
Lubomir Rintel
1b0ee8756b contrib/checkpatch: check for SPDX tags 2019-09-10 11:20:03 +02:00
Lubomir Rintel
24028a2246 all: SPDX header conversion
$ find * -type f |xargs perl contrib/scripts/spdx.pl
  $ git rm contrib/scripts/spdx.pl
2019-09-10 11:19:56 +02:00
Lubomir Rintel
e4784327c0 contrib/spdx: add a tool that determines SPDX licensing headers
This is a one-off hacky tool that we'll use to convert the long license
boilerplates to SPDX headers that are more friendly to automated tools.

Then we can drop it and forget it existed.
2019-09-10 11:18:49 +02:00
Lubomir Rintel
66f75ce34d docs: include the license boilerplate instead of full GPL text
What's actually needed here is an explaination of how the license
applies along with the explanation where to find the full text.

Also, the libnm documentation was lacking the licensing information
altogether. Fix fixes it too.
2019-09-10 11:10:52 +02:00
Lubomir Rintel
e9f2ea6c22 COPYING: make sure we ship the relevant license texts
This adds LGPL and GFDL texts from the GNU web site and updates the GPL
one:

  COPYING: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
  COPYING.LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
  COPYING.GFDL: https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt

The update to the GPL text is purely cosmetic. However, shipping the
exact same file as GNU publishes may help distros that deduplicate the
license texts or hardlink duplicates.
2019-09-10 11:10:52 +02:00
Lubomir Rintel
7a72c705ac initrd: add devicetree support
This adds capability to hand over the network configuration from
OpenFirmware (and potentially other boot loaders with openfirmware
support such as U-Boot) to NetworkManager.

It's done analogously to ACPI/iBFT. In fact, the same ip=ibft command
line option is used, adding a more general ip=fw alias. This probably
deserves some documentation, but I'm not adding any at this time.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/257
2019-09-10 11:04:51 +02:00
Lubomir Rintel
a9777d9178 merge: branch 'lr/olpc-mesh'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/262
2019-09-07 17:22:42 +02:00
Lubomir Rintel
f537056589 platforn/linux: don't fall back to WEXT for OLPC Mesh
nl80211 offers the same functionality sans the bugs.
2019-09-07 17:22:00 +02:00
Lubomir Rintel
13bd678dd5 wifi/olpc-mesh: fix the stage2
There's multiple things wrong there, but unnoticed because the error handling
was entirely missing or nobody is using thie anymore.

The Mesh ID needs to be set while the device is down. Also, the channel
needs to be set last, because that's what triggers the connection
attempt. For that the device needs to be up.

Also, fix the error handling.
2019-09-07 17:22:00 +02:00
Lubomir Rintel
ad86ee4d48 wifi/olpc-mesh: drop assert(companion) from get_autoconnect_allowed()
The comment is wrong. Since 6eaded9071 ('device: add
get_autoconnect_allowed() virtual function'), get_autoconnect_allowed()
is called before the device state is consulted.
2019-09-07 17:22:00 +02:00
Lubomir Rintel
cc96771f32 wifi: add OLPC Mesh support via nl80211 2019-09-07 17:22:00 +02:00
Beniamino Galvani
11cf082a62 build: use regexp in gtkdoc --ignore-decorators option
gtkdoc-scan supports regular expressions in the --ignore-decorators
command-line option. Since it is easier to use a regexp than grepping
macros from a source file, revert the ugly solution from commit
2d941dc95a ('build: fix errors when building with gtk-doc 1.32').
2019-09-06 14:18:24 +02:00
Francesco Giudici
a0498e0829 meson: fix build_clean.sh -w meson -w test
Fixes: 2d941dc95a ('build: fix errors when building with gtk-doc 1.32')
2019-09-05 13:07:41 +02:00
Francesco Giudici
eb5bcb1ded dhcp: merge branch 'fg/nettools_persist_lease'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/246
2019-09-05 12:14:39 +02:00
Francesco Giudici
9f89516928 dhcp: nettools: read/write lease files
Use the same format of systemd-netword, so that we will be compatible
with the leases created/read by the current "internal" plugin.
Note that actually only the leased address is processed when reading a
lease file, so no need to save more than the ip address when saving the
lease.
2019-09-05 12:13:36 +02:00
Francesco Giudici
f60a60a0d0 dhcp: dhclient: use the shared function to retrieve the lease file path
... but leave in place the custom checks dependant on the dhclient plugin
2019-09-05 12:13:36 +02:00
Francesco Giudici
ee20761ea8 dhcp: prefer nm_assert() to g_assert*() 2019-09-05 12:13:36 +02:00
Francesco Giudici
89814d90aa dhcp: internal: use the shared function to retrieve the lease file path 2019-09-05 12:13:36 +02:00
Francesco Giudici
afb9bb0dac dhcp: add a shared function to retrieve the dhcp lease file
For each plugin we try to come up with a lease file constructed in the
same way, i.e., plugin name + iface + connection duid. If the file isn't
already there, for some plugins (dhclient) we do extra checks in order
to allow to use lease files generated outside of NetworkManager. Let's
allow to generate the common NetworkManager dhcp lease file name in a
shared function, reporting to the caller if the file isn't already there,
so that further plugin specific checks can be performed if needed.
2019-09-05 12:13:36 +02:00
Beniamino Galvani
2ca8b511e6 core: add audit log for the SaveHostname call
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/260
2019-09-05 11:42:01 +02:00
Beniamino Galvani
4bd192a350 core: add defines for common authentication-related error messages
All D-Bus method call implementations use similar error messages when
authenticating requests; add defines for them to ensure the same exact
message is reused.
2019-09-05 11:41:57 +02:00
Beniamino Galvani
2d941dc95a build: fix errors when building with gtk-doc 1.32
gtkdoc-scan 1.32 performs stricter checks on structures definitions
and so it complains on:

 /build/networkmanager/src/NetworkManager/libnm/./nm-vpn-plugin-old.h:0: warning: partial declaration (struct) : typedef struct {
 	NM_DEPRECATED_IN_1_2
 	GObject parent;
 } NMVpnPluginOld NM_DEPRECATED_IN_1_2;

because of the unrecognized token 'NM_DEPRECATED_IN_1_2'.

Pass all allowed macros to gtkdoc-scan through the --ignore-decorators
argument.

https://gitlab.gnome.org/GNOME/gtk-doc/issues/98
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/238
2019-09-05 11:17:54 +02:00
Thomas Haller
de6f0bc6db core/tests: avoid deprecated g_main_run()/g_main_loop_unref() in test
These are deprecated. Also, they are nowadays implemented as macros
that expand to

  #define g_main_run(loop) g_main_loop_run(loop) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_loop_run)

This can cause compilation failure (in some environments).
2019-09-03 18:13:27 +02:00
Beniamino Galvani
dbfbbed53c core: merge branch 'bg/device-realize-failed-rh1686634'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/252
https://bugzilla.redhat.com/show_bug.cgi?id=1686634
2019-09-03 16:53:15 +02:00
Beniamino Galvani
f07aa329b2 manager: keep device if realize() fails
system_create_virtual_device() first creates the device (unrealized)
and then, if there a connection for the device with autoconnect=yes,
creates the backing resources. If this last step fails the device
should continue to exist, even if in an unrealized state.

https://bugzilla.redhat.com/show_bug.cgi?id=1686634
2019-09-03 16:53:04 +02:00
Beniamino Galvani
4bc4156424 device: don't set nm-owned flag if realize() fails
The nm-owned flag indicates whether the device was created by NM. If
the realization step fails, the device was not created and so nm-owned
should not be updated.
2019-09-03 16:53:04 +02:00
Davide Palma
6a7c2d44ae po: fixed typo in it.po
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/259
2019-09-03 16:04:03 +02:00
Lubomir Rintel
4534c6c366 core: fix a typo
s/grater/greater/
2019-09-03 11:43:56 +02:00
Beniamino Galvani
eec6951949 device: fix crash when master connection fails
When the master AC becomes ready, activate_stage1_device_prepare() is
called in a idle handler. If the master AC fails in the meantime, it
will change state to deactivating or deactivated. We must check for
that condition before proceeding with slave activation. Note the the
'master_ready' flag of an AC is never cleared after it is set.

Fixes: 5b677d5a3b ('device: move check for master from nm_device_activate_schedule_stage2_device_config() to end of stage1')

https://bugzilla.redhat.com/show_bug.cgi?id=1747998
2019-09-03 09:00:44 +02:00
Lubomir Rintel
74a7626940 libnm/remote-connection: add a pair of curly brackets
...to aid readability.
2019-09-02 14:58:43 +02:00
Lubomir Rintel
b76da15dbf clients: avoid clearing a structure pointer when we're still using it
We're dereferencing the info pointer in the argument list in the call to
nm_client_activate_connection_async(). Stealing it at that point causes
a crash.

This reverts a chunk of commit b298f2e605 ('cli: use cleanup macro for
freeing AddAndActivateInfo').
2019-09-02 14:58:43 +02:00