Commit graph

303 commits

Author SHA1 Message Date
Lubomir Rintel
5b7e7feccd nmcli/edit: fix an assertion failure when tab-completing bad setting name
Attempt to tab-complete a property from a setting which does not exist
results in an assertion failure:

  nmcli > set lala.lala<TAB>

  (process:597363): nm-CRITICAL **: 16:30:21.642: nm_meta_setting_info_editor_find_by_name: assertion 'setting_name' failed

  Thread 1 "nmcli" received signal SIGTRAP, Trace/breakpoint trap.
  0x00007ffff780dc28 in g_logv () from /lib64/libglib-2.0.so.0
  (gdb) bt
  #0  0x00007ffff780dc28 in g_logv () at /lib64/libglib-2.0.so.0
  #1  0x00007ffff780dea3 in g_log () at /lib64/libglib-2.0.so.0
  #2  0x000000000044a2c2 in nm_meta_setting_info_editor_find_by_name (setting_name=<optimized out>, use_alias=use_alias@entry=0)
      at src/libnmc-setting/nm-meta-setting-access.c:35
  #3  0x000000000042eb07 in get_setting_and_property (prompt=<optimized out>, line=<optimized out>, setting_out=0x7fffffffcf10, property_out=0x7fffffffcf18)
      at src/nmcli/connections.c:6639
  #4  0x000000000042ec38 in get_allowed_property_values (out_to_free=out_to_free@entry=0x7fffffffcf50) at src/nmcli/connections.c:6711
  #5  0x000000000042ed8c in should_complete_property_values (prompt=prompt@entry=0x5befb0 "nmcli 802-1x.pac-file> ", line=line@entry=0x0, multi=multi@entry=0x7fffffffcfe4)
      at src/nmcli/connections.c:6735
  #6  0x000000000042f5d8 in nmcli_editor_tab_completion (text=0x5bef90 "lala", start=<optimized out>, end=13) at src/nmcli/connections.c:6899
  #7  0x00007ffff776dcdc in gen_completion_matches () at /lib64/libreadline.so.8
  ...

Do not proceed resolving the setting name if it does not pass
check_valid_name().
2024-08-21 05:40:46 +00:00
Jan Vaclav
ca47fd882e nmcli/edit: fix memory leak in extract_setting_and_property
In case the user selects a setting/property with "goto" command, and
then attempts to tab-complete a setting/property pair, the original sett
and prop strings are overriden without freeing:

  nmcli > goto 802-1x.pac-file
  nmcli 802-1x.pac-file> set 802-1.lal<TAB>

Fixes: 79bc271685 ('cli: TAB-completion for enum-style property values (rh #1034126)')
2024-08-21 05:40:01 +00:00
Fernando Fernandez Mancera
79221f79a2 src: drop most slave references from the code
While we cannot remove all the references to "slave" we can remove most
of them.
2024-08-09 15:47:32 +02:00
Fernando Fernandez Mancera
090d617017 src: drop most master references from the code
While we cannot remove all the references to "master" we can remove most
of them.
2024-08-09 15:47:32 +02:00
Íñigo Huguet
f05a286df4 nmcli: ignore non-base setting names for connection type
Not all setting names are valid values for the value of the connection's "type".
However, if a shortened value is introduced, all setting names are
considered, like in:
  Error: bad connection type: 'eth' is ambiguous: ethernet, ethtool

Note that ethtool is not a valid value for "type".

Fix it by considering only "base" settings names.
2024-08-01 12:08:20 +02:00
Beniamino Galvani
a591c0ca95 libnm,nmcli: add a 'wifi.channel-width' setting
At the moment, the access point mode uses 20MHz channels. Introduce a
new 'wifi.channel-width' property that allows the use of a larger
bandwidth, thus increasing performances.
2024-07-10 14:53:32 +02:00
Lubomir Rintel
c8ff1b30fb nmcli/dev: use secret agent for nmcli d [wifi] connect
Instead of asking the Wi-Fi password in advance (or not at all, if we're
creating a new connection for "nmcli d conn"), use the secret agent.

This makes things consistent with other places where we handle the secrets
for an activating connection in nmcli ("nmcli c up", "nmcli d con" with
an existing connection).

This also fixes the situation where the secrets would stop being
required, such as on enrollment via WPS button press on a router.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1960
2024-07-10 14:40:12 +02:00
Lubomir Rintel
6de187cb37 nmcli: always clean up readline on exit
A signal handler is not the only place where we need to clean up after
an in-progress readline() on exit; we may do so when erroring out as
well:

Before (not also the missing line break, which is part of the cleanup):

  $ (sleep 10; nmcli c del 'Red Hat Wi-Fi')
  $ nmcli --ask d wifi connect 'Red Hat Wi-Fi'
  Passwords or encryption keys are required to access the wireless network 'Red Hat Wi-Fi'.
  Password (802-11-wireless-security.psk): Error: Connection activation failed: The device's active connection disappeared.
  $ [terminal messed up, no echo]

After:

  $ (sleep 10; nmcli c del 'Red Hat Wi-Fi')
  $ nmcli --ask d wifi connect 'Red Hat Wi-Fi'
  Passwords or encryption keys are required to access the wireless network 'Red Hat Wi-Fi'.
  Password (802-11-wireless-security.psk):
  Error: Connection activation failed: The device's active connection disappeared.
  $ hello [terminal echo fine, wheee]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1959
2024-06-26 14:15:16 +02:00
Jan Vaclav
7d0115ea98 gen-metadata-nm-settings-nmcli: add missing va_end in _prop_log() after using vaargs
It was missing before.

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

Fixes: af5c1c8019 ('man nm-settings-nmcli: autogenerate the "Format" field')
2024-06-19 11:10:46 +00:00
Fernando Fernandez Mancera
a4bbdeaf54 src: fix code formatting to last clang version 2024-05-30 15:23:37 +02:00
Michael Biebl
22314df2ab typo fix: identifer -> identifier
Detected by lintian:
I: network-manager: typo-in-manual-page identifer identifier [usr/share/man/man5/nm-settings-nmcli.5.gz:3018]
I: network-manager: typo-in-manual-page identifer identifier [usr/share/man/man5/nm-settings.5.gz:3018]
2024-05-23 10:22:33 +00:00
Íñ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