Commit graph

22399 commits

Author SHA1 Message Date
Thomas Haller
7da44cf877 contrib/rpm: merge branch 'th/contrib-rpm-f30'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/93

(cherry picked from commit d804ad8119)
2019-03-07 09:58:08 +01:00
Thomas Haller
a227149bf2 contrib/rpm: remove Group tag for Fedora 30+
https://fedoraproject.org/wiki/Changes/Remove_Group_Tag

62adcbc888
(cherry picked from commit 1feeba6f1a)
2019-03-07 09:57:50 +01:00
Thomas Haller
c110c1983e contrib/rpm: use "%ldconfig_scriptlets" for Fedora 30+
https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets

5c6421bc88
(cherry picked from commit ad836541cb)
2019-03-07 09:57:49 +01:00
Thomas Haller
ace926e648 contrib/rpm: require "vala" instead of "vala-tools" for Fedora 30+
The "vala-tools" package was merged into "vala" [1]. While "vala"
now "Provides: vala-tools", update the build requirements for
Fedora 30 and newer.

[1] 82b21cc302

f6c878a04a
(cherry picked from commit 0024485b5a)
2019-03-07 09:57:48 +01:00
Beniamino Galvani
25fdf0ab3a wifi-p2p: fix failed assertion when releasing supplicant interface
Fix the following failed assertion:

  <debug> device[0x11dfec0] (p2p-dev-wlp4s0): P2P: Releasing WPA supplicant interface.
  <debug> supplicant: setting WFD IEs for P2P operation
  (../src/devices/nm-device.c:14769):_set_state_full: runtime check failed: (priv->in_state_changed == FALSE)
  <info>  device (p2p-dev-wlp4s0): state change: unmanaged -> unavailable (reason 'supplicant-failed', sys-iface-state: 'external')
  <debug> device[0x11dfec0] (p2p-dev-wlp4s0): add_pending_action (1): 'waiting-for-supplicant'

supplicant_interfaces_release() can be called during a state change
(for example by device_state_changed()) and so it can't trigger
another state change.

nm_device_wifi_p2p_set_mgmt_iface() now doesn't force an immediate
state change and only schedules a recheck-available. This means that
the device can be in an available state without
priv->mgmt_iface. Adapt the code to deal gracefully with that
situation. In particular, we need to cancel pending timeout sources
(priv->sup_timeout_id) that use the management interface.

Fixes: 27bc2cb22a

https://github.com/NetworkManager/NetworkManager/pull/302
(cherry picked from commit d2e95856e9)
2019-03-06 08:05:48 +01:00
Thomas Haller
bd73a542e8 core,wireguard: merge branch 'th/wireguard-routes'
https://github.com/NetworkManager/NetworkManager/pull/305

(cherry picked from commit 9b56d760af)
2019-03-05 12:25:54 +01:00
Thomas Haller
5bcd443e80 wireguard: implement direct "peer-routes" for WireGuard allowed-ips ranges
(cherry picked from commit 626beaf83e)
2019-03-05 12:23:59 +01:00
Thomas Haller
2d34d06e5f wireguard: add "peer-routes" setting for WireGuard profiles
This setting is not yet implemented.

This adds new API for 1.16.0 and is an ABI break since 1.16-rc1.

(cherry picked from commit d719ad31f0)
2019-03-05 12:23:59 +01:00
Thomas Haller
89d40d6579 wireguard: add "mtu" setting for WireGuard profiles
This adds new API for 1.16.0 and is an ABI break since 1.16-rc1.

(cherry picked from commit d5e93ae613)
2019-03-05 12:23:59 +01:00
Thomas Haller
8068310125 device: expose nm_device_ip_config_new() as internal API
(cherry picked from commit 096247e60b)
2019-03-05 12:23:59 +01:00
Thomas Haller
97da3149f7 device: merge stage3 and stage4 ip-config function for IPv4 and IPv6
(cherry picked from commit 5e71f01605)
2019-03-05 12:23:59 +01:00
Thomas Haller
ec7d9d7115 device/trivial: rename wwan_ip_config to dev2_ip_config
dev2_ip_config (formerly wwan_ip_config) is only set by nm_device_set_dev2_ip_config()
(formerly nm_device_set_wwan_ip_config()), which is only called by NMDeviceModem.

For NMDeviceWireGuard we will also inject additional configuration
in the parent class. Rename and give it a wider purpose. The new name
merely indicates that this IP configuration is injected by a subclass
of NMDevice.

(cherry picked from commit 03b708f7f7)
2019-03-05 12:23:59 +01:00
Thomas Haller
0dcfe1a7e0 device: merge IPv4 and IPv6 variant of nm_device_set_wwan_ip_config()
(cherry picked from commit 99abcf0105)
2019-03-05 12:23:59 +01:00
Thomas Haller
f0e0d24fd6 device: avoid setting an empty dev_ip_config_4 for activate_schedule_ip_config_result()
An empty NMIP4Config instance should have the same effect as %NULL.
Don't create it.

(cherry picked from commit ee63e008d1)
2019-03-05 12:23:59 +01:00
Thomas Haller
b9edea3200 device/trivial: rename dev_ip4_config field
So that it follows the naming pattern of similar fields,
that exist in a variant for IPv4 and IPv6.

(cherry picked from commit 2f88523eef)
2019-03-05 12:23:59 +01:00
Thomas Haller
4f3510acb8 device: unify IPv4 and IPv6 handling of IP state of device
(cherry picked from commit 515e003eff)
2019-03-05 12:23:59 +01:00
Thomas Haller
b019a262b9 device/trivial: rename ip-state fields in NMDevicePrivate
Now they follow the naming pattern of ending in "_4" / "_6".
We will merge them and alias them to an "_x" array, like done
for similar fields.

(cherry picked from commit ca14df5619)
2019-03-05 12:23:59 +01:00
Thomas Haller
215f22cd6f device/trivial: rename IpState to NMDeviceIPState
It will be moved to a header file.

(cherry picked from commit 2076550d8f)
2019-03-05 12:23:59 +01:00
Thomas Haller
af195e1178 device: unify IPv4 and IPv6 device methods for IP configs
It is preferable to treat IPv4 and IPv6 in a similar manner.
This moves the places where we differ down the call-stack.

It also make it clearer how IPv6 behaves differently. I think this
is a bug, but leave it for now.

+         /* If IP had previously failed, move it back to IP_CONF since we
+          * clearly now have configuration.
+          */
+         if (priv->ip6_state == IP_FAIL)
+              _set_ip_state (self, AF_INET6, IP_CONF);

(cherry picked from commit 1585eaf473)
2019-03-05 12:23:59 +01:00
Thomas Haller
186c5b7a65 core: use nm_connection_get_setting_ip_config() helper
(cherry picked from commit 2be022ad68)
2019-03-05 12:23:59 +01:00
Thomas Haller
f58fa6e125 libnm-core: add nm_connection_get_setting_ip_config() helper
(cherry picked from commit 02964c22a6)
2019-03-05 12:23:59 +01:00
Thomas Haller
dbfe592272 core: accept %NULL as source argument for nm_utils_ipx_address_clear_host_address()
Just for convenience.

(cherry picked from commit be107c75c9)
2019-03-05 12:23:59 +01:00
Thomas Haller
a79d9dacf1 build: fix build dependency for generating libnm enum headers before building nm-online
CC       clients/nm_online-nm-online.o
    In file included from ./shared/nm-default.h:311:0,
                     from clients/nm-online.c:34:
    ./libnm/NetworkManager.h:60:10: fatal error: nm-enum-types.h: No such file or directory
     #include "nm-enum-types.h"
              ^~~~~~~~~~~~~~~~~

(cherry picked from commit d8070c7a14)
2019-03-05 10:25:54 +01:00
Beniamino Galvani
1d479c0ad5 merge: branch 'bg/nmcli-agent-fixes'
https://github.com/NetworkManager/NetworkManager/pull/307
(cherry picked from commit d943ea415f)
2019-03-05 09:45:32 +01:00
Beniamino Galvani
42304b34fd clients: fix GVariantBuilder memory leak
Fixes: acf86f68b3
(cherry picked from commit 22c87f0df8)
2019-03-05 09:45:02 +01:00
Beniamino Galvani
f1628ea6f1 clients: fix i/o stream memory leaks
Fixes: 5a0d67f739
(cherry picked from commit 91a644d4a5)
2019-03-05 09:44:59 +01:00
Beniamino Galvani
efce1e34f2 clients: fix keyfile string memory leak
The return value of g_key_file_get_string() was leaked.

Fixes: 5a0d67f739
(cherry picked from commit 082ae508a0)
2019-03-05 09:44:57 +01:00
Beniamino Galvani
72f40fc421 clients: fix double free
@secrets is unreferenced at the end of request_secrets_from_ui() and
so try_spawn_vpn_auth_helper() must take a reference to it.

Fixes: 1a0fc8d437
(cherry picked from commit b57a3a4cc6)
2019-03-05 09:44:56 +01:00
Beniamino Galvani
526f1476db manager: ignore ovs-system master when assuming connections
This change allows NM to assume after a restart a device that has been
enslaved externally to an ovs bridge.

https://bugzilla.redhat.com/show_bug.cgi?id=1676551
(cherry picked from commit 93bbe43695)
2019-03-04 10:48:19 +01:00
Kristjan SCHMIDT
ba209fc4ea po: update Esperanto (eo) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/86
(cherry picked from commit da10058118)
2019-02-26 19:21:36 +01:00
Beniamino Galvani
a806e1b39b wifi: merge branch 'bg/pmf-fix-issue129'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/129
(cherry picked from commit 60365f9dec)
2019-02-26 18:35:54 +01:00
Beniamino Galvani
b837561bb6 supplicant: fix setting pmf when the supplicant doesn't advertise support
wpa_supplicant only advertises pmf support since commit [1], which is
after 2.6. When using a version without that commit (for example,
plain 2.6), we would unconditionally set the global Pmf property to 1
(optional) and then skip setting the per-network property. The result
was that pmf was enabled without the possibility to disable it by
user. The correct behavior is instead to disable pmf on such versions.

[1] https://w1.fi/cgit/hostap/commit/?id=3cdb4ac074f76accf24a51d143db545afad2c90b

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/129
(cherry picked from commit 560a35dd43)
2019-02-26 18:35:09 +01:00
Beniamino Galvani
7cff3136f5 supplicant: clarify ready_count usage
(cherry picked from commit cab17ff8e0)
2019-02-26 18:35:07 +01:00
Thomas Haller
4c8ff6f220 examples: fix handling secrets in nm-wg-set
When setting any secrets via D-Bus' Update2 call, then
it assumes that all settings are reset. That means, when
we modify any secrets in the client, we need to first load
them all.

Anyway, load always all secrets, then we can also print them
in the get output.

Honor WG_HIDE_KEYS like `wg` does.

(cherry picked from commit 6aa9e52bd8)
2019-02-26 09:40:57 +01:00
Thomas Haller
8b4247d31d examples: improve hints about existing WireGuard profiles in nm-wg-set
(cherry picked from commit b5a458c5ff)
2019-02-26 09:40:56 +01:00
Thomas Haller
ab80bf8f87 libnm,core: fix device TYPE for Wi-Fi P2P devices
Don't use "wifip2p" for the type description.

    $ nmcli device
    DEVICE             TYPE      STATE         CONNECTION
    wlan0              wifi      connected     x
    p2p-dev-wlan0      wifip2p   disconnected  --

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/87
(cherry picked from commit 8f6a8d0517)
2019-02-26 09:14:13 +01:00
Thomas Haller
a6160cb131 cli/tests: fix cli tests after changing Polish translations
The tests run nmcli with Polish locale and compare the output.
After modifying Polish translation we must regenerate the expected
output.

Fixes: 01b7b32afb

(cherry picked from commit 3089b7df52)
2019-02-25 16:20:59 +01:00
Piotr Drąg
3089b7df52 po: update Polish (pl) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/91
(cherry picked from commit 01b7b32afb)
2019-02-25 13:18:38 +01:00
Piotr Drąg
a8b960aa57 Mark broken strings in translations as fuzzy
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/89
(cherry picked from commit bccf68da1b)
2019-02-25 13:11:03 +01:00
Thomas Haller
d520f39301 release: update NEWS 2019-02-23 11:03:35 +01:00
Thomas Haller
11f02622aa release: bump version to 1.15.90 (1.16-rc1) 2019-02-23 10:12:12 +01:00
Thomas Haller
efbd292801 release: update NEWS 2019-02-23 10:10:38 +01:00
Thomas Haller
e4147a7d18 release: update NEWS with entires from 1.14.6 2019-02-23 09:44:35 +01:00
Thomas Haller
5551b3ab55 Revert "build/meson: name platform tests like autotools"
Older versions of meson don't support building the same names
multiple times.

  Meson encountered an error in file src/tests/meson.build, line 14, column 2:
  Tried to create target "test-general", but a target of that name already exists.

We really need to use unique filenames everywhere. Revert the name
change for now.

This breaks again the valgrind workaround in "tools/run-nm-test.sh".

This reverts commit 5466edc63e.
2019-02-23 07:40:03 +01:00
Thomas Haller
5466edc63e build/meson: name platform tests like autotools
Meson and autotools should name the tests the same way.
Also, all tests binaries built by autotools start on purpose
with "test-". Do that for meson too.

Also, otherwise "tools/run-nm-test.sh" fails to workaround
valgrind failures for platform tests as it does not expect
the tests to be named that way:

    if [ $HAS_ERRORS -eq 0 ]; then
        # valgrind doesn't support setns syscall and spams the logfile.
        # hack around it...
        if [ "$TEST_NAME" = 'test-link-linux' -o \
             "$TEST_NAME" = 'test-acd' ]; then
            if [ -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then
                HAS_ERRORS=1
            fi
        fi
    fi
2019-02-23 07:24:35 +01:00
Thomas Haller
b1f6d53bc4 build/meson: increase timeouts for some tests
The defaults for test timeouts in meson is 30 seconds. That is not long
enough when running

  $ NMTST_USE_VALGRIND=1 ninja -C build test

Note that meson supports --timeout-multiplier, and automatically
increases the timeout when running under valgrind. However, meson
does not understand that we are running tests under valgrind via
NMTST_USE_VALGRIND=1 environment variable.

Timeouts are really not expected to be reached and are a mean of last
resort. Hence, increasing the timeout to a large value is likely to
have no effect or to fix test failures where the timeout was too rigid.
It's unlikely that the test indeed hangs and the increase of timeout
causes a unnecessary increase of waittime before aborting.
2019-02-23 07:20:49 +01:00
Thomas Haller
8f62c76c0a license: re-license initrd-generator and ibft reader as LGPL
New code we want to add LGPL licensed to make it easier to share code
between libnm and the daemon.

The code in question was only recently added in commit b544f7243d
("initrd: add iBFT reader") and mostly written from scratch by Lubomir.

Some parts were adapted from earlier ibft code.

  $ git shortlog -s -e -- src/settings/plugins/ibft/  ':(exclude)*/meson.build'
       3    Beniamino Galvani <bgalvani@redhat.com>
       1    Colin Walters <walters@verbum.org>
       2    Dan Williams <dcbw@redhat.com>
      17    Dan Winship <danw@redhat.com>
       7    Lubomir Rintel <lkundrak@v3.sk>
      46    Thomas Haller <thaller@redhat.com>

  $ git log --no-merges -L '/^fill_ip4_setting_from_ibft/,/^}/:src/settings/plugins/ifcfg-rh/reader.c' fc9c1f1557b517e799d15802e8f3d0ea43b0daea~ | grep '^Author: ' | sort | uniq
  Author: Dan Williams <dcbw@redhat.com>
  Author: Dan Winship <danw@redhat.org>
  Author: Jiří Klimeš <jklimes@redhat.com>
  Author: Pavel Šimerda <psimerda@redhat.com>

Hence, all non-trival contributions were provided by Red Hat employees
and the copy-right is with Red Hat.

Acked-by: Dan Williams <dcbw@redhat.com>
Acked-by: Dan Winship <danw@redhat.com>
Acked-by: Lubomir Rintel <lkundrak@v3.sk>
2019-02-22 21:06:00 +01:00
Thomas Haller
79af876e0e all/trivial: fix whitespace/indentation 2019-02-22 16:28:12 +01:00
Thomas Haller
46bc5feb99 device: fix suppressing warning log about unsupported IPv6LL handling
Wrongly did not suppress the message

    <warn>  [1550844832.3749] device (tunl0): failed to disable userspace IPv6LL address handling (not-supported)

Fixes: d18f40320d
2019-02-22 15:32:17 +01:00
Beniamino Galvani
de1022285a device: do ARP announcements only after masters have a slave
Delay ARP announcements for masters until the first interfaces gets
enslaved. There is no point in doing it before as the ARP packets
would be dropped in most cases; also, if the first slave is added when
we already started announcing, the MAC of the master is going to
change and so the remaining ARPs will have a wrong "sender mac
address" field.

https://bugzilla.redhat.com/show_bug.cgi?id=1678796

https://github.com/NetworkManager/NetworkManager/pull/301
2019-02-22 14:30:40 +01:00