Commit graph

32965 commits

Author SHA1 Message Date
Thomas Haller c0338526f3 std-aux: move NM_PRAGMA_WARNING_DISABLE() macro from libnm-glib-aux to libnm-std-aux
Will be used by nm_assert().
2024-02-07 08:26:25 +00:00
Thomas Haller 025d6898fe std-aux: add NM_STRINGIFY() macro 2024-02-07 08:26:25 +00:00
Thomas Haller 63ab0d926d libnm: use flexible array member in NMUtilsStrStrDictKey
Otherwise, gcc-14.0.1-0.2.fc40 warns:

  ../src/libnm-core-impl/nm-utils.c: In function _nm_utils_strstrdictkey_create:
  ../src/libnm-core-impl/nm-utils.c:5076:16: error: allocation of insufficient size '1' for type 'NMUtilsStrStrDictKey' {aka 'struct _NMUtilsStrStrDictKey'} with size '2' [-Werror=alloc-size]
   5076 |         return g_malloc0(1);
        |                ^~~~~~~~~~~~
2024-02-07 08:26:25 +00:00
Thomas Haller 5715feebe7 libnm: avoid "-Walloc-size" warning in nm_team_link_watcher_new_ethtool()
gcc-14.0.1-0.2.fc40 warns:

    CC       src/libnm-core-impl/libnm_core_impl_la-nm-setting-team.lo
  ../src/libnm-core-impl/nm-setting-team.c: In function nm_team_link_watcher_new_ethtool:
  ../src/libnm-core-impl/nm-setting-team.c:127:13: error: allocation of insufficient size 16 for type NMTeamLinkWatcher with size 48 [-Werror=alloc-size]
    127 |     watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool));
        |             ^
2024-02-07 08:26:25 +00:00
Beniamino Galvani 9c67bf9ab6 dhcp: merge branch 'bg/dhcp-dscp'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1824
2024-02-06 16:54:50 +01:00
Beniamino Galvani d8b33e2a97 n-dhcp4: change the default DSCP value to 0
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.

Indeed, we got reports of some Cisco switches dropping DHCP packets
because of the CS6 marking.

For these reasons, change the default value to the recommended one,
CS0.
2024-02-06 14:24:40 +01:00
Beniamino Galvani d920b48a5f initrd: add support for rd.net.dhcp.dscp property
Add a new kernel command line option, so that the DSCP value can by
changed even in early boot.
2024-02-06 14:24:40 +01:00
Beniamino Galvani 3cf6a805ba device: support the DHCP DSCP property 2024-02-06 14:24:39 +01: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
Beniamino Galvani 2f543f1154 n-dhcp4: support setting the DSCP value
The client currently always sets the DSCP value in the DS field
(formerly known as "TOS") to CS6. Some network equipment drops packets
with such DSCP value; provide a way to change it.
2024-02-06 14:24:38 +01:00
Stanislas Faye 2370a9005f merge: branch 'sf/expose-global-metered-state-in-nmcli'
cli: Expose global metered state in nmcli

Closes #681

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1856
2024-02-05 20:18:46 +00: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
Javier Sánchez Parra 7e7d3a7981 nmtui: fix WireGuard peer editor empty fields
Previously, input fields for peer attributes such as 'Public Key' were
not pre-populated with the existing settings of the peer. This was due
to the WireGuard peer editor class not setting its peer property during
object construction, as the necessary flag was absent. This commit
addresses and fixes this issue.

Closes #1443

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1851
2024-02-02 12:47:16 +01:00
Fernando Fernandez Mancera 0607340922 merge: branch 'ff/conscious_language_autoconnect_slaves'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1844
2024-01-31 11:38:33 +01:00
Fernando Fernandez Mancera 8a08a74abf all: use the new NMSettingConnection autoconnect-ports property 2024-01-31 11:29:07 +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 b90dd247be setting: add property_type field to _nm_setting_property_define_direct_enum
In order to make _nm_setting_property_define_direct_enum more flexible,
this patch is introducing property_type argument to it. When set to NULL
it will set property_type to nm_sett_info_propert_type_direct_enum.
2024-01-31 11:29:06 +01:00
Fernando Fernandez Mancera 2921fe7aac internal: add direct_is_aliased_field flag to NMSettInfoProperty 2024-01-31 11:29:06 +01:00
Fernando Fernandez Mancera 2f1b599fe3 tests: drop unit tests related to from_dbus/to_dbus function
Defining the wrong from_dbus/to_dbus functions is something not
probable. The unit test is just getting in the way of those who knows
what they do and force contributors to change the same thing in multiple
places.
2024-01-31 11:29:06 +01:00
Thomas Haller 5f7a027f59
glib-aux: fix atomic pattern in nm_ref_string_unref()
It's simply not valid to read the ref-count without an atomic.
The compiler might optimize out the assignment to "r" and read the
_ref_count field multiple times. Thereby, we might at first appear
to be larger than > 1, and later pass 1 to compare-and-exchange.

We need an atomic get here.

Fixes: 19d4027824 ('refstr: inline nm_ref_string_{ref,unref}()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1847
2024-01-30 12:07:29 +01:00
Jan Vaclav d1d96de3a1 merge: branch 'jv/wireless-use-strv'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1803
2024-01-30 11:13:20 +01:00
Jan Vaclav 49322bb66c libnm-core: replace mac_address_blacklist type GArray with NMValueStrv
This replaces the underlying type of mac_address_blacklist, which is currently GArray,
with a more re-usable NMValueStrv, which allows us to implement it as a direct property.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1803
2024-01-30 10:12:32 +00:00
Jan Vaclav 63c4827af2 libnm-core: add direct_strv_not_null property
This property indicates that a non-null strv array is expected, and
an empty strv array should be returned instead of NULL if it hadn't
been created yet.
2024-01-30 10:12:32 +00:00
Jan Vaclav 66887fafef libnm-core: add MAC address handling to _property_direct_set_strv function
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1803
2024-01-30 10:12:32 +00:00
Jan Vaclav 641e717797 libnm-core: fix mac comparison in _remove_mac_blacklist_item_by_value
The comparison checking for MAC address equality had previously been flipped around.

Fixes: b084ad7f2b ('libnm-core: canonicalize hardware addresses in settings')
2024-01-30 10:12:32 +00:00
Íñigo Huguet d2f14b40b5 merge: branch 'main'
Update German translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1850
2024-01-30 07:57:16 +00:00
Christian K 090b392479 Update German translation 2024-01-30 07:56:53 +00:00
Íñigo Huguet 564724086b merge: branch 'main'
Update Russian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1838
2024-01-30 07:27:47 +00:00
jtux270 14b4c99ded Update file ru.po 2024-01-30 07:27:35 +00:00
Jan Vaclav e081c716f1 merge: branch 'jv/meson-build-clean'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1845
2024-01-29 14:21:39 +01:00
Jan Vaclav 43c3409081 contrib: add jq to REQUIRED_PACKAGES
jq is used in contrib/fedora/rpm/release.sh and now
also build_clean.sh, so it should probably be added
to REQUIRED_PACKAGES.
2024-01-29 13:21:16 +00:00
Jan Vaclav 95f7c8e128 contrib/fedora: add --meson option to build_clean
This allows the script user to complete the entire build only using meson instead of autotools.
2024-01-29 13:21:16 +00:00
Jan Vaclav 7502787959 build: include meson-dist-data script in dist generated by autotools
The script had not been previously included in the distribution tarball
due to an oversight.

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

Fixes: 1c41066a40 ('build: include documentation in meson dist')
2024-01-29 13:16:19 +00: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 0ce996ba18
doc: merge branch 'th/doc-mdns'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1467

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1841
2024-01-29 09:52:04 +01:00
Thomas Haller 1128bceab9
doc: clarify limitation of parsing values in "NetworkManager.conf"
This really should be fixed, because it's a non-obvious limitation.
Anyway, document it for now.
2024-01-29 09:50:37 +01:00
Thomas Haller fa503e402d
doc: clarify default for "connection.mdns" in manual
The default in systemd-resolved is nowadays "yes". In any case, since
the setting is configurable systemd-resolved, don't describe it in the
manual page.

Instead, clarify the behavior and try to improve the documentation.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1467
2024-01-29 09:50:29 +01:00
Beniamino Galvani f1761c0184 merge: branch 'bg/vpn-ipv6-route-prefsrc'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1834
2024-01-29 08:58:41 +01:00
Beniamino Galvani c415eaca76 vpn: accept pref-src for IPv6 routes returned by plugins
As done for IPv4 in commit 3b145a33b7 ('vpn-connections: allow the
plugin to specify route preferred src'), allow VPN plugins to return a
preferred source address for routes. Still accept the old format.
2024-01-29 08:54:08 +01:00
Beniamino Galvani 23f45d0e18 vpn: simplify routes parsing code
Split the IPv4 and IPv6 cases to make the following commit simpler.
2024-01-29 08:54:07 +01:00
Stanislas FAYE c3acd38645 release: bump version to 1.47.0 (development) 2024-01-25 01:27:55 +01:00
Stanislas FAYE ee21ca8743 release: bump version to 1.45.90 (1.46-rc1) 2024-01-25 01:16:53 +01:00
Wen Liang 792bf3cdd1 libnm: merge branch 'empty_addr_with_route'
https://issues.redhat.com/browse/RHEL-5098
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1832
2024-01-24 09:24:00 -05:00
Wen Liang 0e7bda8ad8 libnm: allow configuring static route when address is empty
OpenShift MetalLB team requests to configure additional routes
whenever the nodes does not have a configured IP address or route for
the subnet in which MetalLB issues addresses.

Note in linux network stack, it does not matter what interface you add
the address on a node (for example, loopback), the kernel is always
processing arp-requests and sending arp-replies to any of them, this
behavior is considered correct and, moreover, it is widely used in the a
dynamic environment as Kubernetes.

https://issues.redhat.com/browse/RHEL-5098
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1587
2024-01-24 09:15:39 -05:00
Wen Liang cf28660b6a core: check the dhcp enabled flag in l3cfg
The decision to configure or not configure routes without addresses only
related to what method is configured - DHCP and non-DHCP cases. For DHCP
case, the deamon waits until addresses appear first before configuring
the static routes to preserve the behavior mentioned in
https://bugzilla.redhat.com/show_bug.cgi?id=2102212, otherwise, the
daemon can configure the routes immediately for non-DHCP case.
2024-01-24 09:15:39 -05:00
Wen Liang 00c7e4855e l3cfg: add dhcp_enabled_4 and dhcp_enabled_6 properties to NML3ConfigData 2024-01-24 09:15:34 -05:00
Luna Jernberg 7825f53c7c
po: update Swedish (sv) translation
Update Swedish translation for the first time in a while.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1839
2024-01-23 13:51:01 +01:00
Thomas Haller 821710bbaa
libnm: merge branch 'th/setting-no-empty-str-props'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1827
2024-01-23 11:16:04 +01:00
Thomas Haller 955f113f46
libnm/docs: update comment about "apn.gsm" and empty string 2024-01-23 09:43:28 +01:00
Thomas Haller f766ec0a16
libnm: drop some unnecessary direct_string_allow_empty
"nm_setting_hsr_get_port1" is new API and verify() already enforces that
the strings are not empty. The flag is redundant.

Also drop it from a few other places, where it's redundant.
2024-01-23 09:43:27 +01:00