Commit graph

23787 commits

Author SHA1 Message Date
Lubomir Rintel
b6d7e44bd8 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.

(cherry picked from commit ad86ee4d48)
2019-09-07 17:26:16 +02:00
Lubomir Rintel
15e813deff wifi: add OLPC Mesh support via nl80211
(cherry picked from commit cc96771f32)
2019-09-07 17:26:16 +02:00
Beniamino Galvani
a369e61d2a 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').

(cherry picked from commit 11cf082a62)
2019-09-06 14:22:18 +02:00
Lubomir Rintel
b2447b4169 release: bump version to 1.20.3 (development) 2019-09-05 14:44:17 +02:00
Lubomir Rintel
4ef27f896e release: bump version to 1.20.2 2019-09-05 14:33:41 +02:00
Lubomir Rintel
ee8947f11c release: update NEWS 2019-09-05 13:59:57 +02:00
Beniamino Galvani
2c0de62a47 core: add audit log for the SaveHostname call
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/260
(cherry picked from commit 2ca8b511e6)
2019-09-05 11:43:13 +02:00
Beniamino Galvani
45c903dc88 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.

(cherry picked from commit 4bd192a350)
2019-09-05 11:43:11 +02:00
Beniamino Galvani
d5ed990caf 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
(cherry picked from commit 2d941dc95a)
2019-09-05 11:25:36 +02:00
Thomas Haller
9e209138dc 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).

(cherry picked from commit de6f0bc6db)
2019-09-03 18:18:48 +02:00
Beniamino Galvani
0e4d0f8d3f 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
(cherry picked from commit dbfbbed53c)
2019-09-03 16:57:04 +02:00
Beniamino Galvani
5d45ac0650 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
(cherry picked from commit f07aa329b2)
2019-09-03 16:56:47 +02:00
Beniamino Galvani
9d0e8e851f 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.

(cherry picked from commit 4bc4156424)
2019-09-03 16:56:45 +02:00
Davide Palma
36ef996a5f po: fixed typo in it.po
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/259
(cherry picked from commit 6a7c2d44ae)
2019-09-03 16:07:02 +02:00
Lubomir Rintel
3c4a7cd4a9 core: fix a typo
s/grater/greater/

(cherry picked from commit 4534c6c366)
2019-09-03 16:04:48 +02:00
Thomas Haller
18dfbeefd4 keyfile: reorder printing empty [wireguard] section with peers and fix test failure
We want to print the [wireguard] section before printing sections of the
peers. It just looks nicer.

This also fixes a test failure:

  /libnm/settings/roundtrip-conversion/wireguard/2: **
  test:ERROR:./shared/nm-utils/nm-test-utils.h:2254:nmtst_keyfile_assert_data: assertion failed (d1 == data): ("[connection]\nid=roundtrip-conversion-2\nuuid=63376701-b61e-4318-bf7e-664a1c1eeaab\ntype=wireguard\ninterface-name=ifname2\npermissions=\n\n[wireguard-peer.uoGoXWWRxJvu4jDva8pPGA4nxau8B33S+YR+MfPFjxc=]\nendpoint=192.168.255.180:30429\npreshared-key-flags=2\n\n[wireguard-peer.BED73rH9j3OCHYAeXNrW5y5oia/Ngj+M04e9sG7DQOo=]\nendpoint=192.168.188.253:30407\npreshared-key-flags=1\npersistent-keepalive=5070\nallowed-ips=192.168.215.179/32;192.168.120.249/32;a🅱️c::e4:13/128;192.168.157.84/32;a🅱️c::1b:df/128;a🅱️c::b0:84/128;192.168.168.17/32;\n\n[wireguard]\n\n[ipv4]\ndns-search=\nmethod=disabled\n\n[ipv6]\naddr-gen-mode=stable-privacy\ndns-search=\nmethod=ignore\n\n[proxy]\n" == "[connection]\nid=roundtrip-conversion-2\nuuid=63376701-b61e-4318-bf7e-664a1c1eeaab\ntype=wireguard\ninterface-name=ifname2\npermissions=\n\n[wireguard]\n\n[wireguard-peer.uoGoXWWRxJvu4jDva8pPGA4nxau8B33S+YR+MfPFjxc=]\nendpoint=192.168.255.180:30429\npreshared-key-flags=2\n\n[wireguard-peer.BED73rH9j3OCHYAeXNrW5y5oia/Ngj+M04e9sG7DQOo=]\nendpoint=192.168.188.253:30407\npreshared-key-flags=1\npersistent-keepalive=5070\nallowed-ips=192.168.215.179/32;192.168.120.249/32;a🅱️c::e4:13/128;192.168.157.84/32;a🅱️c::1b:df/128;a🅱️c::b0:84/128;192.168.168.17/32;\n\n[ipv4]\ndns-search=\nmethod=disabled\n\n[ipv6]\naddr-gen-mode=stable-privacy\ndns-search=\nmethod=ignore\n\n[proxy]\n")

Fixes: ddd148e02b ('keyfile: let keyfile writer serialize setting with all default values')
(cherry picked from commit 576a128954)
2019-09-02 13:21:01 +02:00
Beniamino Galvani
30d2f6cacc dhcp: fall back to 'internal' client for IPv6 when using 'nettools'
The 'nettools' client doesn't support IPv6, fall back to 'internal'.

(cherry picked from commit c0a825bc8e)
2019-08-29 09:55:32 +02:00
Beniamino Galvani
52241748e8 core: fix adding objects to NMIPConfig with @append_force
If the @append_force argument is set and the object is already in the
list, it must be moved at the end.

Fixes: 22edeb5b69 ('core: track addresses for NMIP4Config/NMIP6Config via NMDedupMultiIndex')
(cherry picked from commit 8b121c7048)
2019-08-28 16:14:13 +02:00
Beniamino Galvani
ebaf890057 core: add test to show nm_ipX_config_replace() bug
Add test to show a wrong result of ip_ipX_config_replace() due to a
bug in _nm_ip_config_add_obj(). When an address is added to the tail
of the index and another address with the same id already exists, the
existing object is left at the same place, breaking the order of
addresses.

(cherry picked from commit 24741bff8b)
2019-08-28 16:14:11 +02:00
Thomas Haller
faf12086c1 acd: fix memleak in acd_event()
Only happens with debug logging enabled. So, not a large problem.

Found by Coverity.

Fixes: d9a4b59c18 ('acd: adapt NM code and build options')
(cherry picked from commit 0300c1823a)
2019-08-27 18:21:24 +02:00
Thomas Haller
ceb1ba69b4 contrib/rpm: explicitly set runstatedir to "/run" when building release tarball
Nowadays, we should prefer "/run" over "/var/run". When not specifying
during ./configure, autotools however still defaults to "/var/run".

This default is also visible in the pre-generated documenation, for
example `man NetworkManager.conf` says

  Unless the symlink points to the internal file /run/NetworkManager/resolv.conf,
  in which case the ...

(cherry picked from commit 081b16cdb8)
2019-08-27 16:32:51 +02:00
Thomas Haller
c658427869 keyfile: merge branch 'th/keyfile-fix-empty-settings'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/248

(cherry picked from commit 01ef7c4079)
2019-08-27 12:07:38 +02:00
Thomas Haller
aca5b672ad keyfile: let keyfile writer serialize setting with all default values
It's important whether a setting is present or not. Keyfile writer
omits properties that have a default value, that means, if the setting
has all-default values, it would be dropped. For [proxy] that doesn't
really matter, because we tend to normalize it back. For some settings
it matters:

  $ nmcli connection add type bluetooth con-name bt autoconnect no bluetooth.type dun bluetooth.bdaddr aa:bb:cc:dd:ee:ff gsm.apn a
  Connection 'bt' (652cabd8-d350-4246-a6f3-3dc17eeb028f) successfully added.

  $ nmcli connection modify bt gsm.apn ''

When storing this to keyfile, the [gsm] section was dropped
(server-side) and we fail an nm_assert() (omitted from the example
output below).

  <error> [1566732645.9845] BUG: failure to normalized profile that we just wrote to disk: bluetooth: 'dun' connection requires 'gsm' or 'cdma' setting
  <trace> [1566732645.9846] keyfile: commit: "/etc/NetworkManager/system-connections/bt.nmconnection": profile 652cabd8-d350-4246-a6f3-3dc17eeb028f (bt) written
  <trace> [1566732645.9846] settings: update[652cabd8-d350-4246-a6f3-3dc17eeb028f]: update-from-dbus: update profile "bt"
  <trace> [1566732645.9849] settings: storage[652cabd8-d350-4246-a6f3-3dc17eeb028f,3e504752a4a78fb3/keyfile]: change event with connection "bt" (file "/etc/NetworkManager/system-connections/>
  <trace> [1566732645.9849] settings: update[652cabd8-d350-4246-a6f3-3dc17eeb028f]: updating connection "bt" (3e504752a4a78fb3/keyfile)
  <debug> [1566732645.9857] ++ connection 'update connection' (0x7f7918003340/NMSimpleConnection/"bluetooth" < 0x55e1c52480e0/NMSimpleConnection/"bluetooth") [/org/freedesktop/NetworkManager>
  <debug> [1566732645.9857] ++ gsm                       [ 0x55e1c5276f80 < 0x55e1c53205f0 ]
  <debug> [1566732645.9858] ++ gsm.apn                   < 'a'

Of course, after reload the connection on disk is no loner valid.
Keyfile writer wrote an invalid setting.

  # nmcli connection reload

Logfile:

  <warn>  [1566732775.4920] keyfile: load: "/etc/NetworkManager/system-connections/bt.nmconnection": failed to load connection: invalid connection: bluetooth: 'dun' connection requires 'gsm' or 'cdma' setting
  ...
  <trace> [1566732775.5432] settings: update[652cabd8-d350-4246-a6f3-3dc17eeb028f]: delete connection "bt" (3e504752a4a78fb3/keyfile)
  <debug> [1566732775.5434] Deleting secrets for connection /org/freedesktop/NetworkManager/Settings (bt)
  <trace> [1566732775.5436] dbus-object[9a402fbe14c8d975]: unexport: "/org/freedesktop/NetworkManager/Settings/55"

(cherry picked from commit ddd148e02b)
2019-08-27 12:01:50 +02:00
Thomas Haller
3ea2337f27 keyfile: refactor _parse_info_find() to get ParseInfoSetting
I thought I would need this, but ended up not using it.

Anyway, it makes sense in general that the function can lookup
all relevant information, so merge it.

(cherry picked from commit e6eb01c18f)
2019-08-27 12:01:50 +02:00
Thomas Haller
b02e3acfb9 keyfile/tests: add unit test showing bug where keyfile writer looses settings that are all-default
(cherry picked from commit f8abb05eba)
2019-08-27 12:01:50 +02:00
Thomas Haller
22800c041c settings/keyfile: check whether profile can be re-read before writing to disk and fail
First of all, keyfile writer (and reader) are supposed to be able to store
every profile to disk and re-read a valid profile back. Note that the profile
might be modified in the process, for example, blob certificates are written
to a file. So, the result might no be exactly the same, but it must still be
valid (and should only diverge in expected ways from the original, like mangled
certificates).

Previously, we would re-read the profile after writing to disk. If that failed,
we would only fail an assertion but otherwise proceeed. It is a bug
after all. However, it's bad to check only after writing to file,
because it results in a unreadable profile on disk, and in the first
moment it appears that noting went wrong. Instead, we should fail early.

Note that nms_keyfile_reader_from_keyfile() must entirely operate on the in-memory
representation of the keyfile. It must not actually access any files on disk. Hence,
moving this check before writing the profile must work. Otherwise, that would be
a separate bug. Actually, keyfile reader and writer violate this. I
added FIXME comments for that. But it doesn't interfere with this
patch.

(cherry picked from commit 3b8aab2999)
2019-08-27 12:01:47 +02:00
Thomas Haller
d92ec1d499 settings/keyfile: log reason why re-read connection cannot be normalized
It's a bug either way, but let's log what exactly went wrong.

(cherry picked from commit 1c2c7d3cb7)
2019-08-27 12:00:55 +02:00
Thomas Haller
2958d04238 shared/tests: add nmtst_keyfile_get_num_keys() helper
(cherry picked from commit a265892385)
2019-08-27 12:00:55 +02:00
Thomas Haller
eaf051270c ifupdown: fix crash loading ifupdown settings with empty entries like bridge-ports and mappings
Fixes: d35d3c468a ('settings: rework tracking settings connections and settings plugins')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/235
(cherry picked from commit e9ccc2da19)
2019-08-24 13:47:38 +02:00
Thomas Haller
6118f808d9 bluetooth: fix leak in get_managed_objects_cb()
Fixes: 1ae5d53354 ('bluez: add support for BlueZ 5')
(cherry picked from commit 25571bb639)
2019-08-23 13:18:43 +02:00
Lubomir Rintel
66d12428b9 contrib/rpm: install our dispatcher scripts into /usr/lib/NetworkManager
That's where they always should have been.

(cherry picked from commit 505208a448)
2019-08-23 08:55:45 +02:00
Thomas Haller
b82f2d9772 wifi: detect FT support per interface and avoid enabling it
Previously we only cared whether supplicant is build with support for
FT. In that case we would pass FT-PSK to supplicant, like

  Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK'

Supplicant would then always try FT with preference, regardless whether
the interface/driver support it. That results in a failure to associate, if
the driver does not support it.

  NetworkManager[1356]: <info>  [1566296144.9940] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK'
  ...
  wpa_supplicant[1348]: wlan0: WPA: AP key_mgmt 0x42 network profile key_mgmt 0x142; available key_mgmt 0x42
  wpa_supplicant[1348]: wlan0: WPA: using KEY_MGMT FT/PSK
  ...
  wpa_supplicant[1348]:   * akm=0xfac04
  ...
  kernel: ERROR @wl_set_key_mgmt :
  kernel: invalid cipher group (1027076)

Since we pass a list of acceptable "key_mgmt" options to supplicant,
FT-PSK should not be used when supplicant knows it's not supported.
That is a supplicant bug.

Regardless, work around it by checking the per-interface capability, and
avoid it if support is apparently not present.

(cherry picked from commit 2f8a4e90f0)
2019-08-20 16:38:25 +02:00
Lubomir Rintel
afd873c17f contrib/rpm: enable IWD (outside RHEL)
Let's enable the option to use IWD as an alternative to wpa_supplicant
for Wi-Fi support. People have been asking for this, it works, and is well
maintained.

(cherry picked from commit b171f20141)
2019-08-16 14:04:45 +02:00
Lubomir Rintel
469f5f6cd5 Revert "po: add Zanata configuration"
Not useful anymore.

This reverts commit c5f40c701e.

(cherry picked from commit 78b6fd47dc)
2019-08-16 14:04:41 +02:00
Lubomir Rintel
abd1e1e090 data: fix the ID_NET_DRIVER udev rule
Systemd v243 is complaining about the wrong substitution there. That is
sort of harmless, because systemd-udevd in that version doesn't need the
rule anyway. But still fix it, to avoid a warning.

Also, newer udevd's $PATH doesn't include sbin. That is also okay,
because we don't need the rule to actually work there. But fix it
anyway.

https://bugzilla.redhat.com/show_bug.cgi?id=1740655
(cherry picked from commit 27d380b70e)
2019-08-16 14:04:20 +02:00
Ludek Janda
9e57873e9c po: RHEL 8.1 translations
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/242
2019-08-15 14:40:08 +02:00
Piotr Drąg
4f77de78a7 po: update Polish (pl) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/238
2019-08-12 11:35:51 +02:00
Thomas Haller
7b29cdbbce NEWS: add new header for future 1.20.2 release 2019-08-10 09:45:10 +02:00
Thomas Haller
1026c8b8eb NEWS: belatedly fix "use at your own risk" warning in NEWS
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/227
2019-08-10 09:38:38 +02:00
Thomas Haller
3a6ec0a5f7 n-dhcp4: allocate memory of right size in n_dhcp4_client_probe_option_new()
Non-critical, as the allocated memory was larger than needed.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/224
(cherry picked from commit b80b25050f)
2019-08-08 07:48:31 +02:00
Thomas Haller
2aeab98639 release: bump version to 1.20.1 (development) 2019-08-06 12:22:47 +02:00
Thomas Haller
c438f01b19 release: bump version to 1.20.0 2019-08-06 12:22:44 +02:00
Thomas Haller
fb49607de1 libnm/doc: add missing "Since: 1.20" comments
(cherry picked from commit e48089b039)
2019-08-06 12:22:16 +02:00
Thomas Haller
fa0c5a41c1 ifupdown: fix assertion during logging %NULL storage in load_eni_ifaces()
(cherry picked from commit ddb08e3602)
2019-08-06 12:22:15 +02:00
Thomas Haller
3cef1b98cc libnm/doc: add Since tag for %NM_SETTING_IP6_CONFIG_METHOD_DISABLED
(cherry picked from commit f988e85025)
2019-08-06 11:52:08 +02:00
Thomas Haller
9374aa5f2f NEWS: update 2019-08-06 11:51:17 +02:00
Beniamino Galvani
47c772354e modem: fix memory leak
Fixes: 9b935fad9b ('modem: don't use GAsyncResult pattern for disconnecting modem')
(cherry picked from commit 22cd9e754b)
2019-08-06 09:17:10 +02:00
Beniamino Galvani
df5d76b0dc libnm-core: fix ifcfg-rh variable name for DHCPv6 hostname
Fixes: 2852b50945 ('ifcfg-rh: add DHCPV6_HOSTNAME and DHCPV6_SEND_HOSTNAME vars')
(cherry picked from commit 657b8b31b0)
2019-08-05 16:01:48 +02:00
Beniamino Galvani
e41bb8fc8e settings: fix memory leak
Fixes: d35d3c468a
(cherry picked from commit 956ffb7e96)
2019-08-05 10:11:08 +02:00
Thomas Haller
8b017dc2fb settings: fix registering AgentManager.RegisterWithCapabilities() twice
Fixes: 297d4985ab
(cherry picked from commit 1634fff1ad)
2019-08-03 18:36:15 +02:00