Commit graph

8 commits

Author SHA1 Message Date
Beniamino Galvani
16d649ea92 wifi: auto-activate devices as soon as the first scan finishes
Currently if we detect that a scan finished in
_scan_notify_is_scanning(), we call immediately _scan_kickoff() (which
might start a new scan) and then we check again whether the device can
autoactivate or whether to remove the wifi-scan pending action.

This means that if the scan takes long enough, when
_scan_notify_is_scanning() is called, it is already time to start
another scan and the device activation will be delayed. It will be
delayed until the scan duration becomes shorter than the
exponentially-growing periodic scan interval.

Fix this by delaying the next scan immediately after a scan result.

Co-authored-by: Thomas Haller <thaller@redhat.com>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/574
2021-02-09 08:55:52 +01:00
Thomas Haller
60800b33b4
all: drop unnecessary cast of g_object_new()
Our cast macros (like NM_AUTH_SUBJECT()) are plain C pointer casts,
unless when building with more asserts enabled.

Still, they are unnecessary and even their ability to check the type
(with more asserts) is not needed, because we must trust glib's
g_object_new() to return reasonable objects. That is a basic
requirement, that we don't need to assert against.

Also, in the majority of cases we don't do this either.
2021-02-08 17:02:09 +01:00
Thomas Haller
f72278eff7
ethtool: add more offload features that kernel supports
New features:

 - ethtool.feature-macsec-hw-offload
 - ethtool.feature-rx-gro-list
 - ethtool.feature-rx-udp-gro-forwarding
 - ethtool.feature-tls-hw-rx-offload
 - ethtool.feature-tx-gso-list
 - ethtool.feature-tx-tunnel-remcsum-segmentation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/735
2021-02-08 15:11:11 +01:00
Beniamino Galvani
6ed95bd8e5 dhcp: fix requesting prefixes in stateless mode
According to RFC3315 section 15.12, Information-request messages can't
include a IA option (such as IA_NA or IA_PD).

When doing stateless DHCPv6, we start the client in the appropriate
mode to issue an Information-request message: with "-S" for dhclient or
calling sd_dhcp6_client_set_information_request(TRUE) for systemd.

However, if we need a prefix later, the client must be restarted to
ask the prefix. Currently both dhclient and systemd clients are still
configured to send an Information-request with prefixes. Fix that.
2021-02-08 11:14:52 +01:00
Beniamino Galvani
1460054815 device: preserve the DHCPv6 mode when renewing the lease 2021-02-08 11:14:52 +01:00
Beniamino Galvani
afe600caae device: set firewall zone when re-entering stage3
The ifindex of a virtual device is set when the kernel link
appears. For OVS interfaces, this happens after NM has added the
record to the ovsdb; since NM needs to know the related port and
bridge when it adds ovs-interface record, and since interfaces are
enslaved when they reach stage3, the ifindex is set during stage3.

This means that the first time
nm_device_activate_schedule_stage3_ip_config_start() is called, the
ifindex is unset. Previously we would just set the firewall state as
initialized and the zone would never be set again. Instead, allow the
zone to be set when re-entering stage3.

nm_device_activate_schedule_stage3_ip_config_start() now always check
for the ifindex. This guarantees that we don't try to change zone for
devices without a kernel link (for example, OVS bridges and ports).

Upon reaching state ip-check, the device now changes the zone also if
an ifindex is present and the zone was not set before. I'm not sure
this can actually happen, because if the device has an ifindex it
should be set during stage3. However I'm leaving this extra check for
completeness.

https://bugzilla.redhat.com/show_bug.cgi?id=1921107
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/737
2021-02-04 10:50:15 +01:00
Beniamino Galvani
a980d9916d ovs: avoid race condition when system interface is removed from ovsdb
Failing the system interface device is almost always the right thing
to do when the ovsdb entry is removed.

However, to avoid that a late device-removed signal tears down a
different, newly-activated connection, let's also check that we have a
master.  Or in alternative, that the device is assumed/external: in
such case it's always fine to fail the device

Fixes: 8e55efeb9d ('ovs: fail OVS system interfaces when the db entry gets removed')

https://bugzilla.redhat.com/show_bug.cgi?id=1923248
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/741
2021-02-04 10:47:51 +01:00
Thomas Haller
ac1a9e03e4
all: move "src/" directory to "src/core/"
Currently "src/" mostly contains the source code of the daemon.
I say mostly, because that is not true, there are also the device,
settings, wwan, ppp plugins, the initrd generator, the pppd and dhcp
helper, and probably more.

Also we have source code under libnm-core/, libnm/, clients/, and
shared/ directories. That is all confusing.

We should have one "src" directory, that contains subdirectories. Those
subdirectories should contain individual parts (libraries or
applications), that possibly have dependencies on other subdirectories.
There should be a flat hierarchy of directories under src/, which
contains individual modules.

As the name "src/" is already taken, that prevents any sensible
restructuring of the code.

As a first step, move "src/" to "src/core/". This gives space to
reorganize the code better by moving individual components into "src/".

For inspiration, look at systemd's "src/" directory.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/743
2021-02-04 09:45:55 +01:00