Commit graph

23875 commits

Author SHA1 Message Date
Lubomir Rintel
435dcc3dc6 n-dhcp4/lease: expose the server IP address
This is useful for network booting.

https://github.com/nettools/n-dhcp4/pull/7
(cherry picked from commit edda3d3606)
2019-11-18 13:44:06 +01:00
Lubomir Rintel
68841b76a6 systemd: add siaddr to lease options
This is so that we end up with a next-server option analogous to what
dhclient helper sends us. Dracut uses this for networked boots.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/329
(cherry picked from commit e475ac7567)
2019-11-18 13:44:06 +01:00
Frank Deng
e1acd336bb utils: alow matching ipv6 new method 'disable'
Make nm_utils_match_connection() match 'ignore' connections with
connections that are generated to have ipv6.method of 'disable'.
Perhaps the ipv6 was disabled globally.

[lkundrak@v3.sk: commit message fixup]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/336
(cherry picked from commit 87c9583282)
2019-11-18 13:44:06 +01:00
Beniamino Galvani
b35fb49a28 merge: branch 'bg/ipv6-accept-ra-rh1734470'
https://bugzilla.redhat.com/show_bug.cgi?id=1734470

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/247
(cherry picked from commit 6cf28fe2c0)
2019-11-15 16:18:30 +01:00
Beniamino Galvani
d1c7c381e4 ipv6: disable kernel handling of RAs (accept_ra)
With accept_ra set to 1, kernel sends its own router solicitation
messages and parses the advertisements. This duplicates what NM
already does in userspace and has unwanted consequences like [1] and
[2].

The only reason why accept_ra was re-enabled in the past was to apply
RA parameters like ReachableTime and RetransTimer [3]; but now NM
supports them and so accept_ra can be turned off again.

Also, note that previously the option was set in
addrconf6_start_with_link_ready(), and so this was done only when the
method was 'auto'. Instead, now we clear it for all methods except
'ignore'.

[1] https://mail.gnome.org/archives/networkmanager-list/2019-June/msg00027.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1734470
[3] https://bugzilla.redhat.com/show_bug.cgi?id=1068673

(cherry picked from commit 5a534529e2)
2019-11-15 16:17:41 +01:00
Beniamino Galvani
08fdea122d ipv6: set neighbor parameters from RAs
IPv6 router advertisement messages contain the following parameters
(RFC 4861):

 - Reachable time: 32-bit unsigned integer.  The time, in
   milliseconds, that a node assumes a neighbor is reachable after
   having received a reachability confirmation.  Used by the Neighbor
   Unreachability Detection algorithm.  A value of zero means
   unspecified (by this router).

 - Retrans Timer: 32-bit unsigned integer.  The time, in milliseconds,
   between retransmitted Neighbor Solicitation messages.  Used by
   address resolution and the Neighbor Unreachability Detection
   algorithm.   A value of zero means unspecified (by this router).

Currently NM ignores them; however, since it leaves accept_ra=1, the
kernel parses RAs and applies those parameters for us [1].

In the next commit kernel handling of RAs will be disabled, so let NM
set those neighbor-related parameters.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/ndisc.c?h=v5.2#n1353

(cherry picked from commit 5f0c6f8d3b)
2019-11-15 16:17:33 +01:00
Beniamino Galvani
188911ae7d device: merge branch 'bg/parent-mtu-rh1723690-part1'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/273
(cherry picked from commit facfc94744)
2019-11-11 10:58:21 +01:00
Beniamino Galvani
49857ed279 device: fix setting MTU from connection when limited by parent
We try to set only one time the MTU from the connection to not
interfere with manual user changes.

If at some point the parent interface changes temporarily MTU to a
lower value (for example, because the connection was reactivated), the
kernel will also lower the MTU on child interface and we will not
update it ever again.

Add a workaround to this. If we detect that the MTU we want to set
from connection is higher that the allowed one, go into a state where
we follow the parent MTU until it is possible to set again the desired
MTU. This is a bit ugly, but I can't think of any nicer way to do it.

https://bugzilla.redhat.com/show_bug.cgi?id=1751079
(cherry picked from commit ec28f5b343)
2019-11-11 10:56:43 +01:00
Beniamino Galvani
9133ba9003 macvlan: update MTU according to parent's one
(cherry picked from commit 4875745bc0)
2019-11-11 10:56:42 +01:00
Beniamino Galvani
c58ce8945d macsec: update MTU according to parent's one
A MACsec connection doesn't have an ordering dependency with its
parent connection and so it's possible that the parent gets activated
later and sets a greater MTU than the original one.

It is reasonable and useful to keep the MACsec MTU configured by
default as the maximum allowed by the parent interface, that is the
parent MTU minus the encapsulation overhead (32). The user can of
course override this by setting an explicit value in the
connection. We already do something similar for VLANs.

https://bugzilla.redhat.com/show_bug.cgi?id=1723690
(cherry picked from commit 438a0a9ad5)
2019-11-11 10:56:39 +01:00
Beniamino Galvani
73597864bb device: introduce generic function to inherit MTU from parent
Introduce a generic function to set a MTU based on parent's one. Also
define a device-specific @mtu_parent_delta value that specifies the
difference from parent MTU that should be set by default. For VLAN it
is zero but other interface types (for example MACsec) require a
positive value due to encapsulation overhead.

(cherry picked from commit 5cf57f4522)
2019-11-11 10:56:36 +01:00
Beniamino Galvani
37720d856a device: expand comment on MTU selection
(cherry picked from commit 6455a4e528)
2019-11-11 10:56:34 +01:00
Beniamino Galvani
f35783c3fb device: reset ip6_mtu on cleanup
ip6_mtu contains the MTU received through IPv6 autoconfiguration; it
should be reset when the connection is deactivated.

https://bugzilla.redhat.com/show_bug.cgi?id=1753128
(cherry picked from commit 353c7c95c1)
2019-11-11 10:50:13 +01:00
Beniamino Galvani
3478b515e5 release: bump version to 1.20.7 (development) 2019-11-06 17:34:33 +01:00
Beniamino Galvani
7910cdfe5a release: bump version to 1.20.6 2019-11-06 17:34:33 +01:00
Beniamino Galvani
2745798198 release: update NEWS 2019-11-06 17:34:33 +01:00
Thomas Haller
9ef4137826 libnm: fix handling "q" (uint16) property types in libnm
NMDeviceVxlan has some "q" type properties. They were not handled:

    $ G_MESSAGES_DEBUG=all PAGER= LIBNM_GLIB_DEBUG=properties-changed nmcli 2>&1 | grep "couldn't be set from D-Bus type"
    libnm-Message: 10:44:04.538: demarshal_generic: NMDeviceVxlan:dst-port (type guint) couldn't be set from D-Bus type q.
    libnm-Message: 10:44:04.538: demarshal_generic: NMDeviceVxlan:src-port-max (type guint) couldn't be set from D-Bus type q.
    libnm-Message: 10:44:04.538: demarshal_generic: NMDeviceVxlan:src-port-min (type guint) couldn't be set from D-Bus type q.
    libnm-Message: 10:44:04.539: demarshal_generic: NMDeviceWireGuard:listen-port (type guint) couldn't be set from D-Bus type q.

(cherry picked from commit e2dac63de6)
2019-11-06 17:30:58 +01:00
Beniamino Galvani
c36da8b990 acd: poll the acd fd after starting the announcements
In nm_acd_manager_announce_addresses() we should not only start the
probes but also add the acd file descriptor to the main loop.
Otherwise, a timer is armed to send the announcements but it never
fires and no announcements are sent.

Fixes: d9a4b59c18 ('acd: adapt NM code and build options')

https://bugzilla.redhat.com/show_bug.cgi?id=1767681
(cherry picked from commit 14992ab9cd)
2019-11-06 16:39:29 +01:00
Beniamino Galvani
8426a2398a merge: branch 'bg/802-1x-optional'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/249
https://bugzilla.redhat.com/show_bug.cgi?id=1698532
(cherry picked from commit 495ae4a676)
2019-11-06 11:48:36 +01:00
Beniamino Galvani
91ea7737fd ethernet: honor the 802-1x.optional property
If the 802.1X authentication fails and 802-1x.optional is set,
continue with activation. In this case, subscribe to the auth-state
supplicant property so that any dynamic IP method can be restarted
when the authentication succeeds. This is because upon authentication
the switch could have changed the VLAN we are connected to.

(cherry picked from commit 8afce75bf3)
2019-11-06 11:46:05 +01:00
Beniamino Galvani
90671a30b7 all: add 802-1x.optional property
Introduce a 802-1x.optional boolean property that can be used to
succeed the connection even after an authentication timeout or
failure.

(cherry picked from commit 8763e6da9c)
2019-11-06 11:46:04 +01:00
Beniamino Galvani
2c9912d812 supplicant: export authentication state
Add a property to the supplicant to indicate the current state of the
authentication process.

(cherry picked from commit 5b4f4a4c30)
2019-11-06 11:46:02 +01:00
Thomas Haller
e59f6f593f device/trivial: rename local variable for device in "nm-device-{ethernet,macvlan}.c"
This variable is commonly called "device", not "dev". Rename.

(cherry picked from commit f42ced162f)
2019-11-06 11:46:00 +01:00
Beniamino Galvani
cf557bf06f settings: fix updating agent-owned VPN secrets
property_to_dbus() returns NULL when called with
NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED and the property is
not an agent-owned secrets. The function doesn't handle VPN secrets
correctly, since they are all stored as a hash in the vpn.secrets
property and the flag for each of them is a matching '*-flags' key in
the vpn.data property. VPN secrets must be handled differently; do it
in the VPN setting to_dbus_fcn() function.

Fixes: 71928a3e5c ('settings: avoid cloning the connection to maintain agent-owned secrets')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/230
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/280
(cherry picked from commit 43b7e66948)
2019-11-05 14:34:05 +01:00
Lubomir Rintel
ee2b37e714 merge: branch 'sharkcz/s390-initrd'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/317

(cherry picked from commit 8eb20013ab)
2019-11-04 21:42:09 +01:00
Lubomir Rintel
4c7d12cb29 initrd/tests: test that we generate the s390 interface names correctly
(cherry picked from commit 927ae6d927)
2019-11-04 16:24:42 +01:00
Dan Horák
56026dd3dd initrd: handle rd.znet with legacy interface names
Handle rd.znet with legacy interface names too, the index for eth or ctc
corresponds to the position on the command line.

(cherry picked from commit 22e388d90e)
2019-11-04 16:24:40 +01:00
Dan Horák
72fcf35cb6 initrd: prepare interface in rd.znet only if persistent interface names are enabled
When processing the rd.znet option set the interface name only in case when
the persistent interface names feature isn't disabled via net.ifnames=0

[lkundrak@v3.sk: minor tweaks to the net.ifnames=0 parsing]

(cherry picked from commit c7423dca89)
2019-11-04 16:24:39 +01:00
Dan Horák
31d44a28e1 initrd/tests: use a valid combination of device and interface name for testing
(cherry picked from commit c27f5030e9)
2019-11-04 16:24:39 +01:00
Dan Horák
deff651704 initrd: use proper interface when adding s390 specific details
The current solution for s390 specific details relies on an interface to
exist before adding the s390 details. It means the ip= option must precede
the rd.znet= option. Also only a single interface can be configured. With
this change the s390 details are put to the right interface and properly
named interface is created if it hasn't existed yet.

(cherry picked from commit adcc52c3da)
2019-11-04 16:24:38 +01:00
Lubomir Rintel
9e6706edb7 iwd: unbreak iwd-1.0
The upstream apparently thought it's a great idea to change the agent
manager path. This fixes things for those unfortunate enough to run
IWD.

(cherry picked from commit 186d22a963)
2019-11-03 13:06:04 +01:00
Lubomir Rintel
8a668d0983 iwd: add some missing error handling
g_dbus_object_manager_get_interface() can happily return NULL and we
need to check for that.

(cherry picked from commit 59923ad85d)
2019-11-03 13:06:03 +01:00
worldofpeace
4c11364201 build: add PPPD_PATH to config.h.meson
Without this using -Dpppd= was completely broken.

First observed in NixOS [0]

[0]: https://github.com/NixOS/nixpkgs/issues/72330

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/323
(cherry picked from commit e1ead6fa98)
2019-11-01 07:35:24 +01:00
Lubomir Rintel
cab2e4fc96 libnm/utils: fix build
We don't have NM_WIFI_DEVICE_CAP_IBSS_RSN in 1.20.x series. Don't allow
SAE on ad-hoc networks, we don't allow WPA2 in 1.20.x either.
2019-10-11 10:18:38 +02:00
Beniamino Galvani
58ffded2d0 dhcp: include conditionals from existing dhclient configuration
Since commit 159ff23268 ('dhcp/dhclient-utils: skip over
dhclient.conf blocks') we skip blocks enclosed in lines containing '{'
and '}' because NM should ignore 'lease', 'alias' and other
declarations. However, conditional statements seem useful and should
not be skipped.

https://bugzilla.redhat.com/show_bug.cgi?id=1758550
(cherry picked from commit b58e4d311d)
2019-10-10 14:53:01 +02:00
Beniamino Galvani
299fbc0888 supplicant: allow PMF with SAE
PMF can be used with SAE, allow it. Actually, it is required according
to WPA3 specifications but there are implementations that don't
require it (hostapd can be configured in a such way); so let's not
make it mandatory for WPA3.

Fixes: 6640fb4b36 ('supplicant: add support for SAE key management')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/257
(cherry picked from commit e36c297fd8)
2019-10-09 13:09:42 +02:00
Lubomir Rintel
2c4195bb74 libnm/utils: add SAE security type
https://github.com/NetworkManager/NetworkManager/pull/354
(cherry picked from commit 0ff1cb556c)
2019-10-09 12:48:45 +02:00
Lubomir Rintel
fb874e6cda bluetooth: don't set the ifindex after the device has been activated
The Bluetooth DUN device's NMModem would signal the reset of ifindex to zero
when it's disconnected and the NMDeviceBt would accordingly update the
bluetooth device's ip ifindex. This is not okay since commit ab4578302d
('device: refactor nm_device_set_ip_ifindex() and set_ip_iface()') which,
although claiming to be a refactoring, made such use of
nm_device_set_ip_ifindex() illegal. Resetting the ifindex is anyway not
necessary, since it's taken care of _cleanup_generic_post().

Let's leave the ifindex alone once the device is activated, in a manner
analogous to what NMDeviceModem.

Fixes: ab4578302d ('device: refactor nm_device_set_ip_ifindex() and set_ip_iface()')
Fixes: 78ca2a70c7 ('device: don't set invalid ip-iface'):
(cherry picked from commit a5ca504b5b)
2019-10-09 12:48:29 +02:00
Lubomir Rintel
56036d85ec build: regenerate config-extra.h if configure was re-run with different arguments
(cherry picked from commit 140619854e)
2019-10-09 12:48:22 +02:00
Lubomir Rintel
24d40570a7 contrib/checkpatch: fix the systemd code path
(cherry picked from commit ae6668ae85)
2019-10-08 13:39:53 +02:00
Thomas Haller
af4671cda0 run-nm-test: fix using exec instead of running and exiting
Otherwise, the script tries to run

  dbus-run-session -- exec ...

which fails (because `exec` is a shell command, not a program).
After the failure, the code falls through to run the test under
valgrind.

Fixes: 6a58c55ca4 ('run-nm-test: Just use exec instead of running and exiting')
(cherry picked from commit b9c4d2bb72)
2019-10-08 13:35:26 +02:00
Marco Trevisan (Treviño)
44bb65485f run-nm-test: Just use exec instead of running and exiting
(cherry picked from commit 6a58c55ca4)
2019-10-08 13:35:26 +02:00
Marco Trevisan (Treviño)
963ff8c2ab run-nm-test: Set NM_TEST_UNDER_VALGRIND accordingly
When a test is going to be run under valgrind we set NM_TEST_UNDER_VALGRIND
so that we can properly check whether this is happening.

(cherry picked from commit 073eda68fc)
2019-10-08 13:35:26 +02:00
Thomas Haller
9a37702311 checkpatch,gitlab-ci: let checkpatch script compare against latest upstream master
When opening a merge request from a fork of NetworkManager, then the
pipeline runs with the a checkout of the fork. That means, checkpatch
would compare the branch against "master" (or "nm-x-y" stable branches)
of the fork, instead of upstream.

That doesn't seem too useful. Instead, also add upstream NetworkManager
as git remote, fetch the branches, and use the branches from there as
base for checkpatch.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/255
(cherry picked from commit 3019648b4b)
2019-10-08 12:48:44 +02:00
Thomas Haller
27c23b0748 gitlab-ci: workaround unit test failure for iproute2 bug in "ubuntu:devel"
"ubuntu:devel" ships iproute2 version "5.2.0-1ubuntu1". This has a well known
bug that prevents it from creating IP tunnels during the unit tests.

We already workaround that on Debian. Add the same workaround to match the
Ubuntu package.

(cherry picked from commit 44193d3def)
2019-10-01 10:04:22 +02:00
Thomas Haller
fe1af3c23b release: bump version to 1.20.5 (development) 2019-09-30 08:36:04 +02:00
Thomas Haller
27dee3b113 release: bump version to 1.20.4 2019-09-30 08:34:38 +02:00
Thomas Haller
9044773b91 release: update NEWS 2019-09-30 08:32:47 +02:00
Thomas Haller
98e4efd917 clients/tests: fix expected client test output
Fixes: 275a7c46a1 ('clients/tests: don't include the source line number with client tests output')
2019-09-27 17:22:00 +02:00
Beniamino Galvani
7b9abe94bf device: fix wrong string compare in _commit_mtu()
Fixes: e6628fa27c ('ipv6: add 'disabled' method')

https://bugzilla.redhat.com/show_bug.cgi?id=1753128
(cherry picked from commit 5f284e1574)
2019-09-27 13:41:05 +02:00