Commit Graph

25949 Commits

Author SHA1 Message Date
Thomas Haller
fc11843fdc shared/c-siphash: reimport
git subtree pull --prefix shared/c-siphash git@github.com:c-util/c-siphash.git master --squash
2020-06-03 22:10:22 +02:00
Thomas Haller
adea439ed2 Squashed 'shared/c-siphash/' changes from 7c42c5925819..996b79578d94
996b79578d94 ci: switch to c-util automation
2d159c7da1d5 ci: switch to github-actions
191416c20ec1 ci: drop broken armv7hl
719b1b0138a2 build: update submodules

git-subtree-dir: shared/c-siphash
git-subtree-split: 996b79578d94a6569c42aae1bf806e63b8c6fa9a
2020-06-03 22:09:14 +02:00
Thomas Haller
f9641b6b47 shared/c-rbtree: reimport
git subtree pull --prefix shared/c-rbtree git@github.com:c-util/c-rbtree.git master --squash
2020-06-03 22:08:05 +02:00
Thomas Haller
01e12646a6 Squashed 'shared/c-rbtree/' changes from b46392d25de7..7624b79b26d0
7624b79b26d0 ci: switch to c-util automation
c8cf17527845 ci: run additional CI with ptrace
7069619bc3a5 ci: switch to github-actions
fa97402c3faa ci: drop broken armv7hl
4d48f58a3c31 build: update submodules

git-subtree-dir: shared/c-rbtree
git-subtree-split: 7624b79b26d020a796fe7c624a4f2d3340f3d66b
2020-06-03 22:07:07 +02:00
Thomas Haller
a75d7de78b shared/c-stdaux: reimport
git subtree pull --prefix shared/c-stdaux git@github.com:c-util/c-stdaux.git master --squash
2020-06-03 22:05:14 +02:00
Thomas Haller
bcf93a2800 Squashed 'shared/c-stdaux/' changes from 11930d259212..3b35c47d2bee
3b35c47d2bee ci: switch to c-util automation
8b8f941c57a7 ci: switch to github-actions
d6ecce8afbb7 ci: drop broken armv7hl

git-subtree-dir: shared/c-stdaux
git-subtree-split: 3b35c47d2bee2d1c08fa8bf30e5259155d821712
2020-06-03 22:03:36 +02:00
Thomas Haller
70c71151c6 shared/c-list: reimport
git subtree pull --prefix shared/c-list git@github.com:c-util/c-list.git master --squash
2020-06-03 22:00:56 +02:00
Thomas Haller
722510b73d Squashed 'shared/c-list/' changes from 2e4b605c6217..ac7c83139821
ac7c83139821 ci: switch to c-util automation
6c53ef1c0066 ci: switch to github-actions
b1cd4dbf967d Fix assignment instead of comparison
50e67beedbd9 ci: drop broken armv7hl

git-subtree-dir: shared/c-list
git-subtree-split: ac7c831398219acd8d63038e866035a6f86f9e21
2020-06-03 21:59:32 +02:00
Thomas Haller
b698c92861 TODO: add new items 2020-06-03 20:03:34 +02:00
Thomas Haller
b5c440f54a TODO: drop completed item "Implement NM_DEVICE_STATE_DISCONNECTING"
This seems to be done.
2020-06-03 20:03:34 +02:00
Thomas Haller
e171ae5f7a TODO: drop completed item "Internet Connectivity Detection Enhancements"
This is mostly done. What is not done is to delay the ACTIVATED state
until the connectivty check passed. Delaying that might be problematic
and should only be done as opt-in. Unclear whether that would ever be useful
though.
2020-06-03 20:03:34 +02:00
Thomas Haller
462877084f core: fix maybe-uninitialized warning in periodic_update_active_connection_timestamps()
../src/nm-manager.c: In function periodic_update_active_connection_timestamps:
  ../src/nm-manager.c:7358:43: error: t may be used uninitialized in this function [-Werror=maybe-uninitialized]
     nm_settings_connection_update_timestamp (nm_active_connection_get_settings_connection (ac),
                                             ^
Fixes: 6f3ae8a563 ('core: in periodic_update_active_connection_timestamps() use same timestamp')
2020-06-03 20:03:34 +02:00
Thomas Haller
aeb81183de core: drop mask argument from nm_settings_connection_autoconnect_blocked_reason_get()
We don't need the mask argument. If the caller wants to check only for certain
flags, she can do that right away with

  NM_FLAGS_ANY (nm_settings_connection_autoconnect_blocked_reason_get (sett_con), flags)
2020-06-03 18:35:54 +02:00
Thomas Haller
fce4fa1cbf settings: merge branch 'unblock-autoconnect-on-secrets'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/507
2020-06-03 18:31:20 +02:00
Alfonso Sánchez-Beato
440a5c03b3 settings: unblock autoconnect on new secrets
When the secrets for a connection are updated, unblock autoconnection
in case it had been blocked previously due to bad or no
secrets. Otherwise we would need to manually activate the connection
or restart NM to get another try with the new secrets.
2020-06-03 18:29:12 +02:00
Alfonso Sánchez-Beato
fcfc12d50f settings: move up autoconnect initialization functions
Move autoconnect initialization functions up so we can use them from
update_auth_cb.
2020-06-03 18:29:12 +02:00
Thomas Haller
6022af9963 wifi: merge branch 'th/connection-timestamp-for-wifi'
https://bugzilla.redhat.com/show_bug.cgi?id=1781253

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/524
2020-06-03 18:26:52 +02:00
Thomas Haller
9be9ad4843 NEWS: update 2020-06-03 18:25:33 +02:00
Thomas Haller
835175e4fb Revert "wifi: don't autoconnect to networks that have never been successful"
As commit ccfe5fec8d ('wifi: don't autoconnect to networks that have
never been successful') explains, Wi-Fi profiles only autoconnected
if they had no or a positive timestamp.

The problem that tried to solve is when a user accidentally clicks on a
Wi-Fi network in applet. Then the created profile may not be usable
(because of wrong credentials). To avoid indefinitely to autoconnect,
uch a profile will have a timestamp of 0, which prevents further
auto activations.

However, I find that problematic.

An important use case is pre-deploying profiles. In that case, the user
cannot set the timestamp, because the timestamp cache
/var/lib/NetworkManager/timestamps is internal, undocumented API. Also,
ifcfg-rh doesn't support the timestamp and anyway, does the timestamp
of the NMConnection does not get honored (only the one from the
timestamps file).
Maybe that could be an alternative solution here, to allow the user to
mark profiles as "I really want it to autoconnect". But that seems
unnecessary and wrong to me.

The problem really is that the user cannot do anything to ensure that
autoconnect will work tomorrow (short of editing the timestamps
database). The problem is that the property of whether a profile
every connected successfully is not in direct control of the user (it
depends on external conditions).

If the user has bogus profiles configured, those profiles should be
deleted (or autoconnect disabled) and not keep autoconnect blocked.

Also note that if you are at home and accidentally click on your
neighbour's Wi-Fi network, then you presumably still also have a working
profile to your own network. That usable profile will have a more
recent timestamp and be preferred during autoconnect already.

This reverts commit ccfe5fec8d.

https://bugzilla.redhat.com/show_bug.cgi?id=1781253
2020-06-03 18:25:33 +02:00
Thomas Haller
a9d20141b9 core: log changes to the profile timestamp 2020-06-03 18:25:33 +02:00
Thomas Haller
c3db3e0044 core: don't do anything if there are no changes in nm_settings_connection_update_timestamp()
Updating the timestamp marks the keyfile database as dirty. Avoid
that, if there is no change. Of course, nm_key_file_db_set_value()
itself already checks whether the are any changes, and does nothing
if there aren't.

Simply perform the check earlier, to do nothing.
2020-06-03 18:25:32 +02:00
Thomas Haller
6f3ae8a563 core: in periodic_update_active_connection_timestamps() use same timestamp
When performing  a synchronous action together (like iterating
over all settings and set the current timestamp), it's nicer
to pretend that all this would happen instantaneously. That means,
ensure we use the same timestamp throughout.

On a minor point, there really is no need to call time() multiple times.
2020-06-03 18:25:11 +02:00
Thomas Haller
968b444603 initrd: drop unused include of platform header 2020-06-03 18:08:37 +02:00
Thomas Haller
1c2d9581e9 initrd: use nm_streq()/NM_IN_STRSET() instead of strcmp()
Code like

»···»···if (strcmp (tag, "net.ifnames") == 0)
»···»···»···net_ifnames = strcmp (argument, "0") != 0;

is really hard to understand (at least to me). Compare to

»···»···if (nm_streq (tag, "net.ifnames"))
»···»···»···net_ifnames = !nm_streq (argument, "0");
2020-06-03 18:00:05 +02:00
Thomas Haller
b4fb2a4f94 contrib/rpm: remove trailing whitespaces from spec file 2020-05-29 17:06:59 +02:00
Beniamino Galvani
043be7699c release: bump version to 1.25.2-dev 2020-05-29 16:14:16 +02:00
Beniamino Galvani
2a9c009a21 NEWS: update 2020-05-29 16:14:16 +02:00
Thomas Haller
268e162581 NEWS: update 2020-05-29 13:42:04 +02:00
Thomas Haller
31516a47bd core: merge branch 'th/ethtool-reset-autoneg'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/356
https://bugzilla.redhat.com/show_bug.cgi?id=1807171

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/523
2020-05-29 12:49:14 +02:00
Thomas Haller
0b23ae3158 device: reset original autoneg/speed/duplex setting on deactivate
The autoneg/speed ethtool settings are important. If they are wrong,
the device might not get any carrier. Having no carrier means that
you may be unable to activate a profile (because depending on
configuration, carrier is required to activate a profile).

Since activating profiles are the means to configure the link settings
in NetworkManager, and activating a profile can be hampered by wrong link
settings, it's important to reset the "correct" settings, when deactivating
a profile.

"Correct" in this case means to restore the settings that were present
before NM changed the settings. Presumably, these are the right once.

Beyond that, in the future it might make sense to support configuring
the default link settings per device. So that NM will always restore a
defined, configured, working state. The problem is that per-device
settings currently are only available via NetworkManager.conf, which
is rather inflexible.

Also, when you restart NetworkManager service, it leaves the interface
up but forgets the previous setting. That possibly could be fixed by
persisting the previous link state in /run. However, it's not
implemented yet.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/356
https://bugzilla.redhat.com/show_bug.cgi?id=1807171
2020-05-29 12:49:05 +02:00
Thomas Haller
23d0a76b16 device: inline nm_platform_ethtool_init_ring() function
nm_platform_ethtool_init_ring() only has one caller. It's simpler to
drop the function and implement it at the only place where it is needed.

Maybe there could be a place for a function to initialize NMEthtoolRingState,
one option after the other. However, at the moment there is only one
user, so don't implement it.

This fixes various minor issues:

- the function had a NMPlatform argument, although the argument
  is not used. Thus function merely operates on a NMEthtoolRingState
  instance and shouldn't have a nm_platform_*() name.

- nm_platform_ethtool_init_ring() returned a boolean, but all
  code paths (except assertion failures) returned success.

- as the function returned an error status, the caller was compelled
  to handle an error that could never happen.

- the option was specified by name, although we already have a more
  efficient way to express the option: the NMEthtoolID. Also, the
  caller already needed to resolve the name to the NMEthtoolID, so
  there was no need to again lookup the ID by name.
2020-05-29 12:49:04 +02:00
Thomas Haller
9c236416c8 device: only ready existing ethtool ring settings if needed
Imagine you have a veth device. That device supports certain offload features
(like "ethtool.feature-rx-checksum") but doesn't support any ring
options. Even trying to read the current ring settings will fail.

If you try to activate that profile, NMDevice previously would always
try to fetch the ring options and log a warning and extra debugging
messages:

  <trace> [1590511552.3943] ethtool[31]: ETHTOOL_GRINGPARAM, v: failed: Operation not supported
  <trace> [1590511552.3944] ethtool[31]: get-ring: failure getting ring settings
  <warn>  [1590511552.3944] device (v): ethtool: failure getting ring settings (cannot read)

It does so, although you didn't specify any ring settings and there
was no need to fetch the ring settings to begin with.

Avoid this extra logging by only fetching the ring option when they
are actually required.
2020-05-29 12:49:04 +02:00
Beniamino Galvani
da3b534d45 merge: branch 'bg/ipv6-kernel-token-rh1819680'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/519
https://bugzilla.redhat.com/show_bug.cgi?id=1819680
2020-05-28 18:38:59 +02:00
Beniamino Galvani
49305559dc core: clear IPv6 kernel token when deactivating a device
Clear the IPv6 kernel token when deactivating a device.
2020-05-28 18:38:27 +02:00
Beniamino Galvani
1d6b9953ad device: set accept_ra to 1 when changing IPv6 kernel token
Setting the kernel token is not strictly necessary as the IPv6 address
is generated in userspace by NetworkManager. However it is convenient
for users to see that the value set in the profile is also set in the
kernel, to confirm that everything is working as expected.

The kernel allows setting a token only when 'accept_ra' is 1:
temporarily flip it if necessary. Unfortunately this will also
generate an additional Router Solicitation from kernel, but this is
not a big issue.
2020-05-28 18:38:27 +02:00
Beniamino Galvani
b74c333413 team: merge branch 'bg/team-no-dbus-rh1784363'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/513
https://bugzilla.redhat.com/show_bug.cgi?id=1784363
2020-05-28 18:32:11 +02:00
Beniamino Galvani
d689380cfc team: support operation without D-Bus
When D-Bus is not available, detect that teamd is ready by watching
the presence of the unix domain socket instead of the D-Bus name.

https://bugzilla.redhat.com/show_bug.cgi?id=1784363
2020-05-28 18:31:38 +02:00
Beniamino Galvani
7ac72f8655 team: ensure that teamd is running for assumed devices
When a team device is assumed, we skip stage1 and imply that teamd is
already running. If this doesn't happen (for example because teamd was
manually stopped or because the interface was created in the initrd),
the team interface will continue processing traffic but will not react
to changes in the environment (e.g. carrier changes). Ensure that
teamd is running for assumed devices.
2020-05-28 18:31:38 +02:00
Thomas Haller
266d054808 ifcfg-rh: merge branch 'th/ifcfg-rh-802-1x-pin'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/520
2020-05-28 18:06:25 +02:00
Thomas Haller
655fd1ebd8 ifcfg-rh: support persisting 802-1x.pin and pin-flags property 2020-05-28 18:05:15 +02:00
Thomas Haller
b4537f2c03 libnm,ifcfg-rh: fix documentation for IEEE_8021X_SYSTEM_CA_CERTS in man nm-settings-ifcfg-rh
Fixes: 2a4fb75d3b ('ifcfg: add support for "802-1x.system-ca-certs" setting')
2020-05-28 18:05:15 +02:00
Thomas Haller
9fde21504e libnm,ifcfg-rh: fix documentation for IEEE_8021X_PASSWORD_RAW_FLAGS in man nm-settings-ifcfg-rh
Fixes: a83ab252ee ('ifcfg-rh: add support for 802-1x.password-raw property')
2020-05-28 18:05:14 +02:00
Beniamino Galvani
9dfc1c4a36 tc: merge branch 'bg/qdisc-sync-rh1815875'
https://bugzilla.redhat.com/show_bug.cgi?id=1815875
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/516
2020-05-28 17:26:40 +02:00
Beniamino Galvani
53aa5bd207 platform: add tc tests 2020-05-28 17:25:31 +02:00
Beniamino Galvani
9064502834 platform: rework qdisc synchronization
Rework qdisc synchronization. The previous implementation added all
known qdiscs and removed unneeded ones from platform; this had some
problems:

 - kernel doesn't allow to add (with exclusive flag) a qdisc if one
   with the same parent already exists;

 - if we use the replace flag instead of add, then it becomes possible
   to add a new qdisc with the same parent of an existing one. However
   if the existing qdisc is of the same kind, kernel will try to to
   change() it, which fails for some qdiscs (e.g. sfq).

 - kernel doesn't allow to delete a qdisc with handle of zero because
   that is the default qdisc and can only be replaced;

Fix that.
2020-05-28 17:25:22 +02:00
Beniamino Galvani
9a4578c8f9 platform: use ECHO flag for qdisc and filter requests
By default the kernel sends back events notification to all other
process except the one that requested the change, unless the ECHO flag
is used. See [1], [2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/sched/sch_api.c?h=v5.6#n979
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/core/rtnetlink.c?h=v5.6#n706
2020-05-28 17:25:22 +02:00
Beniamino Galvani
3957d40f54 initrd: don't generate new connections for rd.znet
The rd.znet specifies the s390 parameters of an existing
connection. If no matching connection exists, we should not create a
new one.

https://bugzilla.redhat.com/show_bug.cgi?id=1840287
2020-05-28 14:34:44 +02:00
Beniamino Galvani
eff0e0d123 device: add mechanism to call stage1 for external or assumed devices
Usually stage1 is skipped for external or assumed devices. Add a
mechanism to call stage1 for all devices, similarly to what was
already done for stage2.
2020-05-27 15:49:02 +02:00
Thomas Haller
9cbab5d3e7 license: merge branch 'quozl:relicense-one-laptop-per-child'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/521
2020-05-27 12:42:38 +02:00
Thomas Haller
e0c220e7e9 libnm,ifcfg-rh: merge branch 'th/ifcfg-rh-ca-path'
https://bugzilla.redhat.com/show_bug.cgi?id=1840210
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/448

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/518
2020-05-27 10:28:51 +02:00