Commit graph

292 commits

Author SHA1 Message Date
Íñigo Huguet
7ec363a79a ip6: revert to using sysctl ipv6.conf.default for ip6-privacy
Commit 797f3cafee ('device: fall back to saved use_tempaddr value
instead of rereading /proc') changed the behaviour of how to get the
last resort default value for ip6-privacy property.

Previously we read it from /proc/sys/net/ipv6/conf/default, buf after
this commit we started to read /proc/sys/net/ipv6/conf/<iface> instead,
because the user might have set a different value specific for that device.
As NetworkManager changes that value on connection activation, we used
the value read at the time that NetworkManager was started.

Commit 6cb14ae6a6 ('device: introduce ipv6.temp-valid-lifetime and
ipv6.temp-preferred-lifetime properties') introduced 2 new IPv6 privacy
related properties relying on the same mechanism.

However, this new behaviour is problematic because it's not predictable
nor reliable:
- NetworkManager is normally started at boot time. That means that, if a
  user wants to set a new value to /proc/sys/net/ipv6/conf/<iface>,
  NetworkManager is likely alread running, so the change won't take
  effect.
- If NetworkManager is restarted it will read the value again, but this
  value can be the one set by NetworkManager itself in the last
  activation. This means that different values can be used as default in
  the same system boot depending on the restarts of NetworkManager.

Moreover, this weird situation might happen:
- Connection A with ip6-privacy=2 is activated
- NetworkManager is stopped. The value in
  /proc/sys/net/ipv6/conf/<iface>/use_tempaddr remains as 2.
- NetworkManager starts. It reads from /proc/sys/... and saves the value
  '2' as the default.
- Connection B with no ip6-privacy setting is activated. The '2' saved
  as default value is used. The connection didn't specify any value for
  it, and the value '2' was set by another connection for that specific
  connection only, not manually by a user that wanted '2' to be the
  default.

A user shouldn't have to think on when NetworkManager starts or restarts
to known in an easy and predictable way what the default value for
certain property is. It's totally counterintuitive.

Revert back to the old behaviour of reading from
/proc/sys/net/ipv6/conf/default. Although this value is used by the
kernel only for newly created interfaces, and not for already existing
ones, it is reasonable to think on these settings as "systemwide
defaults" that the user has chosen.

Note that setting a different default in NetworkManager.conf still takes
precedence.
2024-05-10 12:01:08 +00:00
Íñigo Huguet
0906bd6e8b doc: remove explanations about certificate schemes from nmcli
The D-Bus and C APIs admit setting the 802.1X certificates as blobs, as
the documentation of the properties explains.  However, this is not
possible from nmcli, where only path to the certificates' files is possible.

This difference in nmcli was explained in the description message that
is shown in nmcli's editor, but this is a documentation that most users
won't ever see, and still the main documentation in nm-settings-nmcli is
missleading.

Add a nmcli specific documentation for the relevant properties and
remove the nmcli's editor descriptions as they are no longer needed.
2024-04-26 07:30:04 +00:00
Íñigo Huguet
7427e9d320 man: fix missing deprecation message
In the gtkdoc comments, the text below tags like `Since: 1.2` is
discarded. In the property `autoconnect-slaves` a line indicating its
deprecation was below one of these tags. As a result, it was missing in
the man page. Fix it.

Fixes: 194455660d ('connection: deprecate NMSettingConnection autoconnect-slaves property')
2024-04-18 13:30:31 +00:00
Alex Henrie
6cb14ae6a6 device: introduce ipv6.temp-valid-lifetime and ipv6.temp-preferred-lifetime properties
When IPv6 privacy extensions are enabled, by default temporary addresses
have a valid lifetime of 1 week and a preferred lifetime of 1 day.
That's far too long for privacy-conscious users, some of whom want a new
address once every few seconds. Add connection options that correspond
to /proc/sys/net/ipv6/conf/*/temp_valid_lft and
/proc/sys/net/ipv6/conf/*/temp_prefered_lft to allow configuring the
address rotation time on a per-connection basis.

The new properties are defined as 32-bit signed integers to match the
sysctl parameters which are also signed, although currently only
positive numbers are valid.
2024-03-20 23:46:32 -06:00
Alex Henrie
797f3cafee device: fall back to saved use_tempaddr value instead of rereading /proc
There may be a per-interface default set by the sysctl
net.ipv6.conf.<iface>.use_tempaddr that is different than
net.ipv6.conf.default.use_tempaddr.
2024-03-20 23:42:22 -06:00
Jan Vaclav
f2d91b4a68 wired: deprecate NMSettingWired mac-address-blacklist property
To embrace inclusive language, deprecate the NMSettingWired
mac-address-blacklist property and introduce mac-address-denylist property.
2024-03-20 15:32:00 +01:00
Tomas Ebenlendr
edc2ba4991 802.1x: add openssl_ciphers setting
Setting for wpa_supplicant openssl_ciphers - openssl sometimes moves
ciphers among SECLEVELs. That is generaly a good thing, but some servers
are too old to support newer ciphers. Thus expert user should be allowed
to define openssl_ciphers per connection, so that they can connect to
old server, while not compromising security of other connections.
2024-03-16 21:30:34 +01:00
Wen Liang
db5b92fa03 libnm: use nm_setting_connection_get_controller() where possible
To enforce conscious language support, use
`nm_setting_connection_get_controller()` where possible and replace
`nm_setting_connection_get_master()`.

https://issues.redhat.com/browse/RHEL-28623

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1882
2024-03-12 09:54:31 +01:00
Jan Vaclav
fa215c6a69 wireless: deprecate NMSettingWireless mac-address-blacklist property
To embrace inclusive language, deprecate the NMSettingWireless
mac-address-blacklist property and introduce mac-address-denylist property.
2024-03-11 11:42:19 +01:00
Fernando Fernandez Mancera
ac4e63ddda ip: support dhcp-send-release in NMSettingIpConfig
Introduce a new option to NMSettingIpConfig. The new option is ternary
type being the default value set to disabled. When enabled,
NetworkManager will instruct the DHCP client to send RELEASE message
when IP addresses are being removed.
2024-03-06 11:14:16 +01:00
Fernando Fernandez Mancera
bd38a19832 connection: add support to down-on-poweroff
The new option at NMSettingConnection allow the user to specify if the
connection needs to be down when powering off the system. This is useful
for IP address removal prior powering off. In order to accomplish that,
we listen on "Shutdown" systemd DBus signal.

The option is set to FALSE by default, it can be specified globally on
configuration file or per profile.
2024-03-04 18:16:54 +00:00
Beniamino Galvani
e686ab35b3 libnm: add generic.device-handler property
Add a new "generic.device-handler" property that specifies the name of
a dispatcher script to be invoked to add and delete the interface for
this connection.
2024-02-21 11:16:01 +01:00
Beniamino Galvani
aa418275cf libnm,nmcli: add macsec.offload property
Introduce a new property to control the MACsec offload mode.
2024-02-21 10:51:57 +01:00
Íñigo Huguet
8a88386e3a sriov: add eswitch-inline-mode and eswitch-encap-mode properties
Those are related to the eswitch mode and can be configured together.
2024-02-20 16:01:27 +01:00
Íñigo Huguet
c61c87f8a6 sriov: add eswitch-mode property
Add property to allow changing the eswitch mode between legacy SRIOV and
switchdev. Allow also to set "preserve" to prevent NM from modifying the
eswitch mode.
2024-02-20 16:01:25 +01:00
Beniamino Galvani
416d596b31 nmcli: fix crash in nmc_connection_check_deprecated()
It's not clear in which circumstances, but 'type' can be NULL as in
the following backtrace:

  nmc_connection_check_deprecated (c=c@entry=0x55d93f937610) at src/nmcli/connections.c:676
  connection_warnings (nmc=nmc@entry=0x55d93f5ae5e0 <nm_cli>, connection=connection@entry=0x55d93f937610) at src/nmcli/connections.c:5464
  add_connection_cb (client=<optimized out>, result=<optimized out>, user_data=0x55d93fc83820) at src/nmcli/connections.c:5510
  g_task_return_now (task=0x55d93fc86fd0 [GTask]) at ../gio/gtask.c:1361
  g_task_return (type=<optimized out>, task=0x55d93fc86fd0 [GTask]) at ../gio/gtask.c:1430
  g_task_return (task=0x55d93fc86fd0 [GTask], type=<optimized out>) at ../gio/gtask.c:1387
  _request_wait_complete () at /lib64/libnm.so.0
  _nm_client_notify_event_emit_parts () at /lib64/libnm.so.0
  _dbus_handle_changes_commit () at /lib64/libnm.so.0
  _nm_client_get_settings_call_cb () at /lib64/libnm.so.0
  _nm_client_dbus_call_simple_cb () at /lib64/libnm.so.0
  g_task_return_now (task=0x55d93f7bd6f0 [GTask]) at ../gio/gtask.c:1361
  g_task_return (type=<optimized out>, task=0x55d93f7bd6f0 [GTask]) at ../gio/gtask.c:1430
  g_task_return (task=0x55d93f7bd6f0 [GTask], type=<optimized out>) at ../gio/gtask.c:1387
  g_dbus_connection_call_done (source=<optimized out>, result=<optimized out>, user_data=0x55d93f7bd6f0) at ../gio/gdbusconnection.c:5895
  g_task_return_now (task=0x55d93f7bd7b0 [GTask]) at ../gio/gtask.c:1361
  complete_in_idle_cb (task=task@entry=0x55d93f7bd7b0) at ../gio/gtask.c:1375
  g_idle_dispatch (source=0x7f15b007c940, callback=0x7f15ca7e4850 <complete_in_idle_cb>, user_data=0x55d93f7bd7b0) at ../glib/gmain.c:6150
  g_main_dispatch (context=0x55d93f77cde0) at ../glib/gmain.c:3344
  g_main_context_dispatch_unlocked (context=0x55d93f77cde0) at ../glib/gmain.c:4152
  g_main_context_iterate_unlocked.isra.0 (context=0x55d93f77cde0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4217
  g_main_loop_run (loop=0x55d93f7589b0) at ../glib/gmain.c:4419
  main (argc=19, argv=0x7fff77359138) at src/nmcli/nmcli.c:1044

Fixes: f377114d6e ('cli: connection: check for deprecated features')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1872
2024-02-20 11:15:14 +01:00
Íñigo Huguet
2ab56e82d4 libnmc: allow user input in ECHO mode for 2FA challenges
Depending on the type of challenge used in the 2FA authentication, the
user input doesn't need to be hidden and sometimes it's even undesired
(it makes more difficult to enter the text).

Allow to VPN plugins to indicate that a secret that is being requested
is a 2FA challenge with ECHO mode enabled:
- When using auth dialog: accept a new option "ForceEcho" that can be
  set to TRUE to enable ECHO.
- When using the fallback method: recognize the prefix
  "x-dynamic-challenge-echo". This indicate both that ECHO should be enabled
  and that this is a 2FA challenge (see previous commit).

The correct way to enable echo mode from VPN plugins is doing both
things: pass the hint prefixed with "x-dynamic-challenge-echo" and add the
option "ForceEcho=true" for the auth dialog.

An attempt to support ECHO mode from NM-openvpn was made by passing
"IsSecret=false", but it didn't work because nm-secret-agent-simple
ignores returned values for which "IsSecret=false". It's not a good idea
to start accepting them because we could break other plugins, and anyway
the challenge response is actually a secret, so it is better to keep it
as such and add this new "ForceEcho" option.

This is backwards compatible because existing plugins were not using the
tag nor the auth dialog option. Withouth them, the previous behaviour is
preserved. On the contrary, plugins that want to use this new feature
will need to bump their NM version dependency because old daemons will
not handle correctly the prefix tag.

Secret agents will need to be updated to check secret->force_echo if
they want to support this feature. Until they update, the only drawback
is that ECHO mode will be ignored and the user's input will be hidden.

Updated nmcli and nmtui to support ECHO mode.
2024-02-15 09:45:44 +00:00
Beniamino Galvani
fcd907e062 libnm,nmcli: add ipvx.dhcp-dscp property
Currently the internal DHCP client sets traffic class "CS6" in the DS
field of the IP header for outgoing packets.

dhclient sets the field according to the definition of TOS (RFC 1349),
which was was deprecated in 1998 by RFC 2474 in favor of DSCP.

Introduce a new property IPvX.dhcp-dscp (currently valid only for
IPv4) to specify a custom DSCP value for DHCP backends that support it
(currently, only the internal one).

Define the default value to CS0, because:

 - section 4.9 of RFC 4594 specifies that DHCP should use the standard
   (CS0 = 0) service class;

 - section 3.2 says that class CS6 is for "transmitting packets
   between network devices (routers) that require control (routing)
   information to be exchanged between nodes", listing "OSPF, BGP,
   ISIS, RIP" as examples of such traffic. Furthermore, it says that:

     User traffic is not allowed to use this service class.  By user
     traffic, we mean packet flows that originate from user-controlled
     end points that are connected to the network.

- we got reports of some Cisco switches dropping DHCP packets because
  of the CS6 marking.
2024-02-06 14:24:39 +01:00
Stanislas FAYE
3bdb8666f2 cli: Implement display of global metered state in nmcli general
This commit introduces the display of the global metered state in the
`nmcli general` command output.
Key changes:
- Parse and display the global metered state
2024-02-05 20:54:28 +01:00
Fernando Fernandez Mancera
194455660d connection: deprecate NMSettingConnection autoconnect-slaves property
To embrace inclusive language, deprecate the NMSettingConnection
autoconnect-slaves property and introduce autoconnect-ports property.
2024-01-31 11:29:06 +01:00
Fernando Fernandez Mancera
e9e456d9ad doc: regenerate docs for "connection.mdns"
As the documentation for "connection.mdns" was modified, we need to
regenerate the docs.
2024-01-29 12:08:32 +01:00
Thomas Haller
955f113f46
libnm/docs: update comment about "apn.gsm" and empty string 2024-01-23 09:43:28 +01:00
Fernando Fernandez Mancera
027b259602 all: use the new NMSettingConnection port-type property 2024-01-23 08:21:16 +01:00
Fernando Fernandez Mancera
411e7573a4 connection: deprecate the NMSettingConnection slave-type property
To embrace inclusive language, deprecate the NMSettingConnection
slave-type property and introduce port-type property.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2024-01-23 08:21:07 +01:00
Beniamino Galvani
790e4231f4 core,libnm: change default value for ipv4.dad-timeout from 0 to 200ms
A duplicate address is a serious issue which leads to non-working
setups or problems hard to debug. Enable IPv4 duplicate address
detection (aka ACD, RFC 5227) by default to detect such problems.

While the RFC recommends a timeout of 9 seconds, a comment in n-acd
sources says:

  A 9s timeout for successful link setups is not acceptable today.
  Hence, we will just go forward and ignore the proposed values. On
  both wired and wireless local links round-trip latencies of below
  3ms are common.  We require the caller to set a timeout multiplier,
  where 1 corresponds to a total probe time between 0.5 ms and 1.0
  ms. On modern networks a multiplier of about 100 should be a
  reasonable default. To comply with the RFC select a multiplier of
  9000.

Set a default timeout of 200ms, which is the double of the value
suggested in n-acd sources. 200ms sounds quick enough, and gives at
least ~100ms to other hosts to reply.

See also the Fedora change proposal:

https://fedoraproject.org/wiki/Changes/Enable_IPv4_Address_Conflict_Detection
2024-01-15 17:07:09 +01:00
Fernando Fernandez Mancera
3e4a2ebb3c all: use the new NMSettingConnection Controller property 2024-01-11 00:19:14 +01:00
Fernando Fernandez Mancera
00bc10b8c0 connection: deprecate the NMSettingConnection Master property
To embrace inclusive language, deprecate the NMSettingConnection Master
property and introduce Controller property.
2024-01-11 00:19:14 +01:00
Fernando Fernandez Mancera
0e893593a9 hsr: drop supervision-address from HSR setting
The supervision address is read-only. It is constructed by kernel and
only the last byte can be modified by setting the multicast-spec as
documented indeed.

As 1.46 was not released yet, we still can drop the whole API for this
setting property. We are keeping the NMDeviceHsr property as it is a
nice to have for reading it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1823

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
2023-12-19 13:54:21 +01:00
Fernando Fernandez Mancera
e68bedd28d all: reformat code to clang shipped with Fedora 39 2023-12-06 10:37:24 +01:00
Fernando Fernandez Mancera
5426bdf4a1 HSR: add support to HSR/PRP interface
This patch add support to HSR/PRP interface. Please notice that PRP
driver is represented as HSR too. They are different drivers but on
kernel they are integrated together.

HSR/PRP is a network protocol standard for Ethernet that provides
seamless failover against failure of any network component. It intends
to be transparent to the application. These protocols are useful for
applications that request high availability and short switchover time
e.g electrical substation or high power inverters.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1791
2023-12-05 08:05:56 +01:00
Thomas Haller
503a76f604
all: use nm_strv_empty_new() helper 2023-11-30 15:53:21 +01:00
Thomas Haller
a2cd6599d2
cli: don't print how many more addresses/routes in nmcli output
Since the number of addresses/routes that the daemon exposes on D-Bus is
now limited, we don't know how many more there would be. Just say
"more".
2023-11-30 15:49:10 +01:00
Thomas Haller
a7a36cde83
cli: limit number of shown addresses/routes in nmcli overview
If you add a large number of addresses/routes, then the output of
`nmcli` is unusable. It also doesn't seem too useful.

Limit the number to show up to 10 addresses and 10 routes.

If there are more than 10 addresses, then print an 11th line with

    inet4 ... N more

Actually, if there are exactly 11 addresses, then don't waste an extra
line to print "1 more". Instead, still print the 11th address. Same for
routes.
2023-11-30 15:38:34 +01:00
Thomas Haller
39d900593b
cli: reuse NMStrBuf in ac_overview()
No need to mix GString and NMStrBuf.
2023-11-30 15:38:34 +01:00
Thomas Haller
6f53f390a2
cli: unifiy handling of IPv4/IPv6 in ac_overview()
As often, the code for IPv4/IPv6 is very similar. It's better to
treat the address family in a similar way.
2023-11-30 15:38:19 +01:00
Thomas Haller
d210923c0f
wifi: add "wifi.cloned-mac-address=stable-ssid"
Add a new "stable-ssid" mode that generates the MAC address based on the
Wi-Fi's SSID.

Note that this gives the same MAC address as setting

    connection.stable-id="${NETWORK_SSID}"
    wifi.cloned-mac-address="stable"

The difference is that changing the stable ID of a profile also affects
"ipv6.addr-gen-mode=stable-privacy" and other settings.
2023-11-16 13:07:54 +01:00
Thomas Haller
587f5afb5a
all: differentiate NM_CLONED_MAC_IS_SPECIAL() for wired/wireless
Will be used next, when we support "stable-ssid" for
"wifi.cloned-mac-address" property.
2023-11-16 13:07:53 +01:00
Thomas Haller
901a1b096b
core: support "${NETWORK_SSID}" for connection.stable-id
For Wi-Fi profiles, this will encode the SSID in the stable-id.
For other profiles, this encodes the connection UUID (but the SSID and
the UUID will always result in distinct stable IDs).

Also escape the SSID, so that the generated stable-id is always valid
UTF-8.
2023-11-16 13:07:53 +01:00
Thomas Haller
36629ae710
libnm: rename "ethtool.eee" property to "ethtool.eee-enabled"
There are various properties related to EEE, that we might want to add
support for in the future (for example, "ethtool.eee-advertise").

Don't use up the base name "eee", instead make it "eee-enabled". All
properties should have different prefixes, and "ethtool.eee" would be a
prefix of "ethtool.eee-advertise".

Also, the #define is already called NM_ETHTOOL_OPTNAME_EEE_ENABLED. This
also should be consistent.

Rename.

Fixes: 3165d9a2de ('ethtool: introduce EEE support')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1792
2023-11-15 09:36:29 +01:00
Thomas Haller
38ad9e5211
cli: sort nmcli device output by active-connection first
Previously, we first sort by the device's state, then by the active
connection's state. Contrast to `nmcli connection`, which first sorts
by the active connection's state.

It means, the sort order is somewhat different. Fix that.

In most cases, that shouldn't make a difference, because the
device's state and the active-connection's state should
correspond. However, it matters as we now treat external activations
different, and that is tied to the active connection.
2023-11-15 09:34:47 +01:00
Thomas Haller
a5f9f2fbfc
cli: sort external connections later in nmcli connection|device
EXTERNAL connections are special. Sort them later. This affects output
of `nmcli connection` and `nmcli device`.
2023-11-15 09:34:47 +01:00
Thomas Haller
8ccd1f7bfe
cli: refactor active_connection_get_state_ord()
Additional logic will be added, that makes the switch() approach
more cumbersome. Use a sorted array instead to find the priority.
2023-11-15 09:34:46 +01:00
Thomas Haller
8e1330964d
cli: fix sorting of active connections
CMP() is a confusing pattern. Sure enough, the sort order was wrong, for
example, `nmcli connection` would show

    $ nmcli -f STATE,UUID,DEVICE c
    STATE       UUID                                  DEVICE
    activating  3098c902-c59c-45f4-9e5a-e4cdb79cfe1b  nm-bond
    activated   e4fc23ac-54ab-4b1a-932a-ebed12c96d9b  eth1

("activating" shown before "activated").

With `nmcli device`, we sort with compare_devices(). This first sorts by
device state (with "connected" being sorted first). Only when the device
state is equal, we fallback to nmc_active_connection_cmp().  So with
`nmcli device` we usually get "connected" devices first, and we don't
really notice that there is a problem with nmc_active_connection_cmp().

On the other hand, `nmcli connection` likes to sort first via
nmc_active_connection_cmp(), which gets it wrong. Profiles in
"activating" state are sorted first. That's inconsistent with `nmcli
device`, but it's also not what is intended.

Fix that.

Note the change in the test output. Both eth1 and eth0 are connected to
to the same profile, but one "eth0" the active-connection's state is
DEACTIVATING, while on "eth1" it's ACTIVATED (but both device's states
are "CONNECTED"). That's why "eth1" is now sorted first (as desired).

Fixes: a1b25a47b0 ('cli: rework printing of `nmcli connection` for multiple active connections')
2023-11-15 09:34:46 +01:00
Thomas Haller
b4dd83975e
all: use NM_MIN() instead of MIN() 2023-11-15 09:32:20 +01:00
Thomas Haller
6f4a60b6f2
all: ensure same signedness of arguments to MIN()/MAX()
Comparing integers of different signedness gives often unexpected
results. Adjust usages of MIN()/MAX() to ensure that the arguments agree
in signedness.
2023-11-15 09:32:18 +01:00
Íñigo Huguet
539d6f436a
gen-metadata-nm-settings-nmcli: fix some printf warnings on 32 bit platforms
The specifiers %ld and %lu are not correct for 64 bit integers on 32 bit
platforms, triggering a warning. Use instead the GLib constants to
correctly define them.

Fixes: 925d4df801 ('man nm-settings-nmcli: add "Valid values" field')
Fixes: 5c6ae44e00 ('man nm-settings-nmcli: add "Special values" field')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1790
2023-11-14 19:14:12 +01:00
Thomas Haller
832065b6e6
libnm/docs: fix generated documentation
Fixes: 82e2eeeb2a ('libnm/docs: clarify default `ipv4.dhcp-client-id` generated by nettools/internal DHCP plugin')
2023-11-14 12:51:22 +01:00
Johannes Zink
3165d9a2de ethtool: introduce EEE support
Some Applications require to explicitly enable or disable EEE.
Therefore introduce EEE (Energy Efficient Ethernet) support with:

 * ethtool.eee on/off

Unit test case included.

Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
2023-11-03 15:41:21 +00:00
Thomas Haller
0554ef3808
all: use nm_g_array_index() instead of g_array_index()
nm_g_array_index() performs additional nm_assert() checks for
correctness.

In this case, it's pretty clear that the assertion will hold and that
the code is correct. Note that most of the time when having assertions,
we expect that they hold. Since nm_assert() is disabled in release
build, arguing that an assertion holds is not a strong argument against
having the assert (they are always supposed to hold, quite obviously so!).

The reason to change is that we should use the wrappers that perform
additional checks. Especially when the additional checks are nm_assert()
or static-asserts, as they are not present in release builds. To find
how well we are doing in this regard we can check `git grep -w
g_array_index`. If that gives many uses of the unchecked function, then
we cannot manually check them all to be really obviously correct.
Instead, we should not use g_array_index() and trivially see that all
array accesses are guarded by assertions.

"checkpatch.pl" also recommends against g_array_index().
2023-10-30 17:15:06 +01:00
Beniamino Galvani
80dd179ffd libnm: add ethtool channels properties
ethtool "channels" parameters can be used to configure multiple queues
for a NIC, which helps to improve performances. Until now, users had
to use dispatcher scripts to change those parameters. Introduce native
support in NetworkManager by adding the following properties:

 - ethtool.channels-rx
 - ethtool.channels-tx
 - ethtool.channels-other
 - ethtool.channels-combined
2023-10-18 06:53:07 +00:00