Compare commits

...

778 Commits

Author SHA1 Message Date
Beniamino Galvani
b4a22ad2a9 platform: fix compilation without LTO
Fix the following error seen when running the build_clean.sh script
with LTO disabled:

  In file included from ../src/libnm-glib-aux/nm-default-glib.h:66,
                   from ../src/libnm-glib-aux/nm-default-glib-i18n-prog.h:13,
                   from ../src/core/nm-default-daemon.h:11,
                   from ../src/core/platform/tests/test-link.c:6:
  In function ‘_nm_auto_freev’,
      inlined from ‘test_link_get_bridge_fdb’ at ../src/core/platform/tests/test-link.c:2732:33:
  ../src/libnm-glib-aux/nm-macros-internal.h:166:8: error: ‘addrs’ may be used uninitialized [-Werror=maybe-uninitialized]
    166 |     if (*p) {
        |        ^
  ../src/core/platform/tests/test-link.c: In function ‘test_link_get_bridge_fdb’:
  ../src/core/platform/tests/test-link.c:2732:33: note: ‘addrs’ was declared here
   2732 |     nm_auto_freev NMEtherAddr **addrs;
        |                                 ^~~~~
  cc1: all warnings being treated as errors

Fixes: 16ef33d380 ('bond-slb: fix memory leak')
2025-07-17 10:30:18 +02:00
Beniamino Galvani
bd41951f1d merge: branch 'bg/bridge-port-fix-reapply'
bridge: fix reapplying port VLANs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2240
2025-07-14 13:04:00 +00:00
Beniamino Galvani
261fa8db33 device: accept changes to the bond-port.vlans during reapply
Commit c5d1e35f99 ('device: support reapplying bridge-port VLANs')
didn't update can_reapply_change() to accept the "bridge-port.vlans"
property during a reapply. So, it was only possible to change the
bridge port VLANs by updating the "bridge.vlan-default-pvid" property
and doing a reapply. Fix that.

Fixes: c5d1e35f99 ('device: support reapplying bridge-port VLANs')
2025-07-14 15:03:06 +02:00
Beniamino Galvani
bf79fbd678 bridge: fix reapplying port VLANs
If the bridge default-pvid is zero, it means that the default PVID is
disabled. That is, the bridge PVID is not propagated to ports.

Currently NM tries to merge the existing bridge VLANs on the port with
the default PVID from the bridge, even when the PVID is zero. This
causes an error when setting the new VLAN list in the kernel, because
it rejects VLAN zero.

Skip the merge of the default PVID when zero.

Fixes: c5d1e35f99 ('device: support reapplying bridge-port VLANs')
2025-07-14 15:03:05 +02:00
Beniamino Galvani
f655cd1cba man: fix nmcli connection types list
Update the nmcli man page to accurately reflect the connection types
supported by NetworkManager:

- Remove ovs-dpdk and ovs-patch (not supported by nmcli)
- Add hsr, ipvlan, and loopback (missing from the documentation)

This ensures the man page matches the actual connection types returned by
'nmcli --complete-args connection add type'.

https://issues.redhat.com/browse/RHEL-100893
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2235
2025-07-14 14:59:00 +02:00
Filip Pokryvka
f584524197 release: bump version to 1.55.2 (development) 2025-07-11 08:33:22 +02:00
Beniamino Galvani
74cf2a2bd8 l3cfg: fix logging message
Fix spacing in:

 acd[192.168.122.42, probing]: probing currently  stillnot possible
                                                 ^^^^^^^^^

Fixes: b8f9d7b5dd
2025-07-10 10:04:36 +02:00
Beniamino Galvani
c983e3bbf5 merge: branch 'bg/misc-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2239
2025-07-10 09:14:00 +02:00
Beniamino Galvani
eb7917a387 ndisc: fix logic to limit the number of addresses
Fixes: c2c8c67d8c ('ndisc: rate limit number of accepted RA data to track')
2025-07-10 09:12:06 +02:00
Beniamino Galvani
b45d5f41dd platform: fix harmless typo
The function should modify the "ip6_address" member of the union. In
practice, it doesn't matter because the ifindex is the first member of
both "ip4_address" and "ip6_address".
2025-07-10 09:12:05 +02:00
Beniamino Galvani
fdb8f07c44 libnm-core: validate the ipvlan mode
The setting must reject unknown ipvlan modes.

Fixes: d238ff487b ('ipvlan: add support to IPVLAN interface')
2025-07-10 09:12:05 +02:00
Beniamino Galvani
104cafdd44 libnm-core: fix documentation for NMSettingMatch functions
Fixes: 3a8e46f2a5 ('settings: add match for proc cmdline')
2025-07-10 09:12:04 +02:00
Beniamino Galvani
f4f1ecc7ea libnm-core: fix p-key validation for Infiniband connections
verify() is setting an error without returning FALSE to make the
validation fail. When the parent is set, the device is a Infiniband
partition and it must have a p-key != -1.

Fixes: d595f7843e ('libnm: add libnm/libnm-core (part 1)')
2025-07-10 09:12:04 +02:00
Beniamino Galvani
fa80896ee7 core: fix Wi-Fi data rate tables
Fixes: f2b0092b5b ('wifi: parse BSS IEs for 80211n and 80211ac data rates')
2025-07-10 09:12:03 +02:00
Beniamino Galvani
b58a37acfe core: fix nm_utils_get_nm_gid()
Fixes: 31dbcb81fe ('core: make nm_utils_get_nm_[ug]id() thread safe')
2025-07-10 09:12:03 +02:00
Beniamino Galvani
16ef33d380 bond-slb: fix memory leak
If sendto() fails, the function returns and the remaining entries are
not deallocated. Use nm_auto_freev instead to free the array and the
pointer it contains.

Add a test to check that nm_auto_freev does the right thing on the
value returned by nm_linux_platform_get_bridge_fdb().

Fixes: 3f2f922dd9 ('bonding: send ARP announcement on bonding-slb link/carrier down')
2025-07-10 09:12:02 +02:00
Beniamino Galvani
7d23ed9f73 platform: rename nm_linux_platform_get_link_fdb_table()
Rename nm_linux_platform_get_link_fdb_table() to
nm_linux_platform_get_bridge_fdb(). The new name better indicates that
the function returns the bridge FDB entries.
2025-07-10 09:12:02 +02:00
Beniamino Galvani
d017dc67b4 dhcp: fix typo in tcp_keepalive_interval option name
Fixes: eed205bff3 ('dhcp/internal: move dhcp options management to shared dhcp codebase')
2025-07-10 09:12:02 +02:00
Beniamino Galvani
a9d7abbc50 dhcp: fix parsing of the search list option
The DHCP search list option (119) can use the "message compression"
algorithm specified in RFC 1035 section 4.1.4 to reduce the size of
the message in presence of subdomains that appear multiple times.

When using the compression a label starts with:

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    | 1  1|                OFFSET                   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

where the offset points to a previous domain.

Previously, the parsing code was taking the lower 6 bits of the first
byte, shifting them left 16 bits, and adding the next byte. Instead,
the shift should be of 8 bits.

The effect of this bug was that when the offset was greater than 255,
it was incorrectly parsed as a number larger than the message size,
and the parsing failed.

Note that while a single DHCP option can be at most 255 bytes, a DHCP
message can contain multiple instances of the same option. The
receiver must concatenate all the occurrences according to RFC 3396
and parse the resulting buffer.

Fixes: 6adade6f21 ('dhcp: add nettools dhcp4 client')
2025-07-10 09:12:02 +02:00
Beniamino Galvani
43f738473c core: remove duplicate include 2025-07-10 09:12:01 +02:00
Beniamino Galvani
50a400e16f supplicant: fix wrong check on "EAP" signal arguments
The check is inverted.

Fixes: b83f07916a ('supplicant: large rework of wpa_supplicant handling')
2025-07-10 09:12:01 +02:00
Beniamino Galvani
ce17284c3f lldp: fix memchr() argument order
The validation of embedded NUL character was skipped due to the wrong
order of arguments to memchr(). Fix it.

Fixes: 4043f82790 ('lldp: cleanup converting binary LLDP fields to string')
2025-07-10 09:12:01 +02:00
Beniamino Galvani
20a1d7e816 vrf: fix wrong logging domain
Fixes: 667568d1b2 ('core,libnm: add VRF support')
2025-07-10 09:12:01 +02:00
Beniamino Galvani
1229fe5abd bond: fix attribute assignment macro
Currently the bug is hidden because the macro is only called with
NM_SETTING_BOND_OPTION_ARP_IP_TARGET.

Fixes: 45c95e9314 ('device/bond: rework setting of arp_ip_target bond options')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
404a3ec853 core: fix properties update for HSR devices
Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
62558d50be core: fix constant name for IPv4 method
Fix the name for consistency, even if this is harmless because the
IPv4 and IPv6 values are the same.
2025-07-10 09:12:00 +02:00
Beniamino Galvani
55765d2914 ovs: fix logging message
Fixes: a259303e1d ('ovs: add support for "other_config" settings')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
253800238e libnm-core,core: accept uid/gid up to (2^32 - 2) for tun devices
Linux UIDs/GIDs are 32-bit unsigned integer, with 4294967295 reserved
as undefined.

Before:
  # useradd -u 4294967294 -M testuser
  useradd warning: testuser's uid -2 outside of the UID_MIN 1000 and UID_MAX 60000 range.
  # nmcli connection add type tun ifname tun1 owner 4294967294 ipv4.method disabled ipv6.method disabled
  Error: Failed to add 'tun-tun1' connection: tun.owner: '4294967294': invalid user ID

After:
  # useradd -u 4294967294 -M testuser
  useradd warning: testuser's uid -2 outside of the UID_MIN 1000 and UID_MAX 60000 range.
  # nmcli connection add type tun ifname tun1 owner 4294967294 ipv4.method disabled ipv6.method disabled
  Connection 'tun-tun1' (5da24d19-1723-45d5-8e04-c976f7a251d0) successfully added.
  # ip -d link show tun1
  2421: tun1: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 500
      link/none  promiscuity 0 allmulti 0 minmtu 68 maxmtu 65535
      tun type tun pi off vnet_hdr off persist on user testuser ...
                                                 ^^^^^^^^^^^^^
Fixes: 1f30147a7a ('libnm-core: add NMSettingTun')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
45ab9d96f1 platform: use g_strdup() instead of strdup() in ethtool code
The string is freed with g_free(), it needs to be allocated with
g_strdup(). In practice, the GLib allocator uses malloc() nowadays,
but it is better to be consistent.
2025-07-10 09:12:00 +02:00
Beniamino Galvani
326fb8f9cf initrd: make parsing of VLANs more robust
We are missing some validations when parsing VLANs: a unexpected
argument can cause a crash, an assertion, or the connection being
dropped without any warning. Make it more robust.
2025-07-10 09:12:00 +02:00
Beniamino Galvani
eff8471de4 nmcli: fix format
Fixes: a9b66e254c ('nmcli: fix compile error')
2025-07-09 15:08:15 +02:00
Beniamino Galvani
959ddec2a4 contrib/nm-vpn-plugin-utils: add nm_vpn_plugin_utils_get_cert_path()
Add a function to generate the path for imported certificates.

See https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/merge_requests/95
2025-07-09 15:06:51 +02:00
Beniamino Galvani
a9b66e254c nmcli: fix compile error
Running the build script with LTO disabled
("contrib/fedora/rpm/build_clean.sh -W lto") gives the following error:

  In file included from ../src/libnm-std-aux/nm-default-std.h:102,
                   from ../src/libnm-glib-aux/nm-default-glib.h:11,
                   from ../src/libnm-glib-aux/nm-default-glib-i18n-lib.h:13,
                   from ../src/libnm-client-aux-extern/nm-default-client.h:11,
                   from ../src/nmcli/connections.c:6:
  In function ‘_nm_auto_unref_ptrarray’,
      inlined from ‘do_connection_add’ at ../src/nmcli/connections.c:6069:35:
  ../src/libnm-std-aux/nm-std-aux.h:1106:12: error: ‘props’ may be used uninitialized [-Werror=maybe-uninitialized]
   1106 |         if (*v)                               \
        |            ^
  ../src/libnm-glib-aux/nm-macros-internal.h:91:1: note: in expansion of macro ‘NM_AUTO_DEFINE_FCN0’
     91 | NM_AUTO_DEFINE_FCN0(GPtrArray *, _nm_auto_unref_ptrarray, g_ptr_array_unref);
        | ^~~~~~~~~~~~~~~~~~~
  ../src/nmcli/connections.c: In function ‘do_connection_add’:
  ../src/nmcli/connections.c:6069:35: note: ‘props’ was declared here
   6069 |     gs_unref_ptrarray GPtrArray  *props;
        |                                   ^~~~~
  cc1: all warnings being treated as errors

Fix it.

Fixes: bb850fda0e ('nmcli: connection: process port-type, type and controller first')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2236
2025-07-08 11:21:02 +02:00
Lubomir Rintel
9bbb113987 device: don't disable IPv6 in stage3 on reapply
Currently, when a call to Reapply() results in stage3 being re-run, IPv6
ends up messed up. Like this:

  $ nmcli device modify eth0 ipv4.address ''
  $ nmcli device modify eth0 ipv4.address 172.31.13.37/24
  $

  NetworkManager[666]: <debug> [1751286095.2070] device[c95ca04a69467d81] (eth0): ip4: reapply...
  ...
  NetworkManager[666]: <debug> [1751286095.2104] device[c95ca04a69467d81] (eth0): ip6: addrgenmode6: set none (already set)
  NetworkManager[666]: <debug> [1751286095.2105] device[c95ca04a69467d81] (eth0): ip6: addrgenmode6: toggle disable_ipv6 sysctl after disabling addr-gen-mode
  NetworkManager[666]: <debug> [1751286095.2105] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '1' (current value is '0')
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0' (current value is '1')
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/accept_ra' to '0' (current value is identical)
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0' (current value is identical)

Not only is this unnecessary because addr-gen-mode already has the
desired value (as is logged), but also wipes off all IPv6 configuration.
This is fine on initial configuration, but not on Reapply().

Let's look at the device state first: if we've progressed past ip-config
state, then we can't possibly ever touch the offending sysctls. It's
okay -- we don't need to: addr-gen-mode is going to be set right if we
went through ip-config before.

Resolves: https://issues.redhat.com/browse/NMT-1681

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2232
2025-07-07 15:38:51 +02:00
Lubomir Rintel
2de6391f4b device: drop a redundant assert
This is essentially:

  a = b
  assert(a == b)

Not useful.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2233
2025-07-07 15:16:34 +02:00
Íñigo Huguet
a39fa7ee6c merge: branch 'ih/spec_git_tag'
spec: add git_tag_version

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2238
2025-07-07 13:09:50 +00:00
Íñigo Huguet
3cba4f2627 spec: add git_tag_version
The URL to the tarball needs the git tag, that might be 1.54-rc1 instead
of 1.53.90. Allow to define it as a separate variable in the spec file.
It can be set as `git_tag_version %{real_version}` when they are
identical.

It is not really needed here in the upstream spec file, as the "Source"
line is commented out, but add it as a reference for donwstream spec
files.
2025-07-07 09:27:05 +02:00
Íñigo Huguet
cc5306e1d0 NEWS: update 2025-07-07 09:14:34 +02:00
Beniamino Galvani
37c0e0860e NEWS: update 2025-07-01 14:26:44 +02:00
Beniamino Galvani
165e5df6e0 nmcli: accept certain IP settings on port connections
Commit bb850fda0e ('nmcli: connection: process port-type, type
and controller first') started correctly rejecting IP configuration
on port connections.

However, previously nmcli would accept IP parameters for ports when
using a specific parameters order. To avoid breaking user scripts that
may have relied on this behavior, introduce a backward compatibility
quirk.

Specifically, nmcli accepts a disabled/ignore IP method on a port
connection. For any other IP setting on a port connection, a specific
error message is now shown.

https://issues.redhat.com/browse/RHEL-90756
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2227
2025-07-01 14:21:23 +02:00
Beniamino Galvani
25a5fd7503 merge: branch 'bg/sriov-preserve-capability'
manager: add a capability for "sriov.preserve-on-down"

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2234
2025-07-01 07:37:17 +00:00
Beniamino Galvani
8e40f7e289 manager: add a capability for "sriov.preserve-on-down"
Add a new capability to indicate that NetworkManager supports the
"sriov.preserve-on-down" connection property. With this, clients can
set the property only when supported, without the risk of creating an
invalid connection.
2025-06-30 22:38:18 +02:00
Beniamino Galvani
ea6af6d806 libnm-core: change version of ip4-forwarding capability
NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING was backported to branch
nm-1-54 before the 1.54 release. Update the symbol version.
2025-06-30 22:33:29 +02:00
Beniamino Galvani
5ab04c8f56 libnm: change "sriov.preserve-on-down" symbols version to 1.54
The "sriov.preserve-on-down" libnm symbols were backported to the 1.54
branch before the final release. Change their version on main to be
"1.54".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2229
2025-06-27 14:11:47 +02:00
Beniamino Galvani
7bb898fa12 libnm: fix g-ir-scanner build warning
Fix the following build warning emitted by g-ir-scanner:

  ../src/libnm-core-public/nm-dbus-interface.h:103: Warning: NM: "@NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING" parameter unexpected at this location:
   * @NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING: Indicates that NetworkManager supports
      ^

Fixes: 6a13e8d369 ('core: expose the version info capability of IPv4 forwarding support')
2025-06-26 13:22:33 +02:00
Beniamino Galvani
9b4569bd94 merge: branch 'bg/route-via'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2222
2025-06-26 11:55:45 +02:00
Beniamino Galvani
24ab3308fe platform: add test for route via attribute 2025-06-26 11:37:17 +02:00
Beniamino Galvani
00257a9cf7 platform: parse the RT_VIA route attribute
Parse the "via" attribute in netlink routes received by kernel, so
that we can update the internal cache.
2025-06-26 11:37:16 +02:00
Beniamino Galvani
9c70a43775 platform: use the "via" attribute in route NMPObject methods
Update the cmd_obj_hash_update(), cmd_obj_cmp(), cmd_obj_to_string()
NMPObject methods for IPv4 routes to consider the "via" attribute.
2025-06-26 11:37:16 +02:00
Mary Strodl
2ffaebd4ae platform: support the RT_VIA attribute for IPv4 routes
The RT_VIA attribute is used to specify a gateway of a different
address family. It is currently used only for IPv4 routes.

[bgalvani@redhat.com: amended the commit message]
2025-06-26 11:37:15 +02:00
Wen Liang
84299ed17c merge: branch 'forwarding_version_info'
core: expose the version info capability sync of forwarding support

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2226
2025-06-24 13:12:28 +00:00
Wen Liang
6a13e8d369 core: expose the version info capability of IPv4 forwarding support
This commit adds NM_VERSION_INFO_CAPABILITY_IPV4_FORWARDING to the
VersionInfo D-Bus property, allowing clients such as nmstate to check
the NetworkManager's support of configuring per-device IPv4 sysctl
forwarding setting directly via the capabilities bitmask instead of
relying on the NetworkManager version comparisons.
2025-06-23 13:30:14 -04:00
Filip Pokryvka
e26e965134 release: bump version to 1.55.1 (development) 2025-06-20 09:19:23 +02:00
Beniamino Galvani
a78f8bbe1b merge: branch 'bg/systemd-fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2223
2025-06-19 15:09:07 +02:00
Beniamino Galvani
9f510533f1 systemd: ignore device_is_devtype()
The function uses symbol sd_device_get_devtype() which is currently
commented out. Therefore, NM dynamically links to the symbol from the
libsystemd shared object, which breaks on machines without systemd.

Before:
$ nm -u build/src/core/NetworkManager | grep sd_device
                 U sd_device_get_sysattr_value@LIBSYSTEMD_240
$

After:
$ nm -u build/src/core/NetworkManager | grep sd_device
$

Fixes: 6a4e6fab40 ('merge: branch 'systemd' into jv/systemd-merge')
2025-06-19 15:08:02 +02:00
Beniamino Galvani
77c99b61c0 Revert "sd-device: use sd_device_get_sysattr_value() to read special symlinks"
Revert systemd commit 6ebbdcc0ddba ("sd-device: use
sd_device_get_sysattr_value() to read special symlinks"). In the NM
codebase sd_device_get_sysattr_value() is currently commented out
because it depends on file chase.c which is not imported. Importing
that file would require another long chain of imports. Therefore,
revert the commit.

This reverts commit 6ebbdcc0ddbacce732001823cf2be2a1d4381c60.

Fixes: 6a4e6fab40 ('merge: branch 'systemd' into jv/systemd-merge')
2025-06-19 15:08:02 +02:00
Beniamino Galvani
fcc5352715 Revert "sd-device: use sd_device_get_sysattr_value() to read uevent file"
Revert systemd commit 17dc9ec4b6e8 ("sd-device: use
sd_device_get_sysattr_value() to read uevent file"). In the NM
codebase sd_device_get_sysattr_value() is currently commented out
because it depends on file chase.c which is not imported. Importing
that file would require another long chain of imports. Therefore,
revert the commit.

This reverts commit 17dc9ec4b6e82fc2a4f9809011e154f538eb8b9c.

Fixes: 6a4e6fab40 ('merge: branch 'systemd' into jv/systemd-merge')
2025-06-19 15:08:02 +02:00
Beniamino Galvani
1253cbad5a connectivity: fix compiler warning when building without concheck
Fix the following:

../src/core/nm-connectivity.c:958:1: warning: ‘check_platform_config’ defined but not used [-Wunused-function]
  958 | check_platform_config(NMConnectivity *self,
      | ^~~~~~~~~~~~~~~~~~~~~

Fixes: 91d447df19 ('device: don't start connectivity check on unconfigured devices')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2224
2025-06-19 15:06:53 +02:00
Íñigo Huguet
dd7f9fdf8e merge: branch 'ih/rm-forwarding-ignore'
ipv4: remove the forwarding=ignore value

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2221
2025-06-19 12:27:49 +00:00
Íñigo Huguet
82692cc75c ipv4: remove the forwarding=ignore value
It is not clear whether we can actually respect this value. For example,
we should not restore the kernel's default value on deactivation or
device's state change, but it is unclear if we can ensure that we'll
still have the connection's configuration in all possible changes of
state.

Also, it is unclear if it's a desirable value that we want to support.
At this point it is mostly clear that trying to configure NM managed
devices externally always ends being dissapointing, no matter how hard
we try.

Remove this value for now, while we discuss whether it makes sense or
not, so it doesn't become stable in the new 1.54 release.
2025-06-19 12:27:35 +00:00
Beniamino Galvani
a4ee55468f merge: branch 'bg/sriov-preserve-on-down'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2219
https://issues.redhat.com/browse/RHEL-69125
2025-06-18 13:22:35 +02:00
Beniamino Galvani
3588c48686 NEWS: update 2025-06-18 13:21:19 +02:00
Beniamino Galvani
6f219aa649 device: allow reapplying the sriov.preserve-on-down property
It is useful when there is an already active device and we want to
bring it down preserving the SR-IOV VFs. For example:

  $ nmcli connection add type ethernet ifname eni1np1 sriov.total-vfs 2 ipv4.method disabled ipv6.method disabled
  $ nmcli connection up ethernet-eni1np1

  $ ip link show eni1np1
  342: eni1np1: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
      link/ether 6e:cf:f0:08:74:f4 brd ff:ff:ff:ff:ff:ff
      vf 0     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
      vf 1     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...

  $ nmcli device modify eni1np1 sriov.preserve-on-down yes
  $ nmcli connection down ethernet-eni1np1

  $ ip link show eni1np1
  342: eni1np1: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
      link/ether 6e:cf:f0:08:74:f4 brd ff:ff:ff:ff:ff:ff
      vf 0     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
      vf 1     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
2025-06-18 13:20:49 +02:00
Beniamino Galvani
c70b4a98a3 core: use the sriov.preserve-on-down property 2025-06-18 13:20:49 +02:00
Beniamino Galvani
eb0a22a162 libnm,nmcli: add sriov.preserve-on-down property
Add a new "sriov.preserve-on-down" property that controls whether
NetworkManager preserves the SR-IOV parameters set on the device when
the connection is deactivated, or whether it resets them to their
default value. The SR-IOV parameters are those specified in the
"sriov" setting, like the number of VFs to create, the eswitch
configuration, etc.
2025-06-18 13:20:49 +02:00
Beniamino Galvani
7212d8b8e9 version: add 1.56 macros 2025-06-18 13:20:49 +02:00
Beniamino Galvani
cceec45089 merge: branch 'bg/nmcli-wg-peers'
nmcli: allow setting the wireguard peers

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2220
2025-06-18 09:08:17 +00:00
Beniamino Galvani
b4dde691ec nmcli: add support for managing wireguard peers
Even if WireGuard is supported since long time in NetworkManager, it
is still not possible to manage the list of peers via nmcli. The
reason is that in the past we wanted to introduce a special syntax
that would allow to manage the peer list more easily. However, this
requires heavy changes to the nmcli output formatting code, and so it
never happened.

Since perfection is the enemy of good, abandon the idea of a custom
handling of peers and treat them as any other composite property. The
property is named "wireguard.peers" and exposes the peers indexed by
public key, with optional attributes.

Example:

  $ nmcli connection modify wg0 wireguard.peers "8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o= preshared-key=16uGwZvROnwyNGoW6Z3pvJB5GKbd6ncYROA/FFleLQA= allowed-ips=0.0.0.0/0 persistent-keepalive=10"
  $ nmcli connection modify wg0 +wireguard.peers "fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1:8888"
  $ nmcli -g wireguard.peers connection show wg0
  8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o= allowed-ips=0.0.0.0/0 persistent-keepalive=10, fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1\:8888
  $ nmcli connection modify wg0 -wireguard.peers 8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o=
  $ nmcli -g wireguard.peers connection show wg0
  fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1\:8888
2025-06-16 13:20:02 +02:00
Beniamino Galvani
f13aca1aba NEWS: update 2025-06-16 10:23:25 +02:00
Jan Vaclav
9abe5658cc merge: branch 'jv/systemd-merge'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2213
2025-06-10 09:23:34 +02:00
Beniamino Galvani
46e0d2b4e4 ovs: set the tun interface up before stage3
When using the netdev datapath, we wait that the tun link appears, we
call nm_device_set_ip_ifindex() (which also brings the link up) and
then we check that the link is ready, i.e. that udev has announced the
link and the MAC address is correct. After that, we schedule stage3
(ip-config).

In this, there is a race condition that occurs sometimes in NMCI test
ovs_datapath_type_netdev_with_cloned_mac. In rare conditions,
nm_device_set_ip_ifindex() bring the interface up but then ovs-vswitch
changes again the flags of the interface without IFF_UP. The result is
that the interface stays down, breaking communications.

To fix this, we need to always call nm_device_bring_up() after the tun
device is ready. The problem is that we can't do it in
_netdev_tun_link_cb() because that function is already invoked
synchronously from platform code.

Instead, simplify the handling of the netdev datapath. Every
"link-changed" event from platform is handled by
_netdev_tun_link_cb(), which always schedule a delayed function
_netdev_tun_link_cb_in_idle(). This function just assigns the
ip-ifindex to the device if missing, and starts stage3 if the link is
ready. While doing so, it also bring the interface up.

Fixes: 99a6c6eda6 ('ovs, dpdk: fix creating ovs-interface when the ovs-bridge is netdev')

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2218
2025-06-06 16:35:12 +02:00
Beniamino Galvani
b678ceab9f merge: branch 'wpa3_transition_fix'
core: fix WPA2 fallback for WPA3 transition APs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2205
2025-06-05 16:15:49 +00:00
Conn O'Griofa
b00c6749d7 core: fix WPA2 fallback for WPA3 transition APs
When connecting to an AP configured for WPA3 transition mode, the
connection will fail if PMF is disabled on the client due to SAE and
FT-SAE being unconditionally added to the key_mgmt variable's
parameters.

By removing the "!is_ap ||" check, SAE and FT-SAE will no longer be
selected when PMF is disabled, allowing clients to connect via
WPA2/PSK mode as per the original intent of
a0988868ba.

Signed-off-by: Conn O'Griofa <connogriofa@gmail.com>
2025-06-05 11:54:16 +00:00
Jan Vaclav
eac9f828e8 tools/nm-in-container: add --skip-unavailable flag for installing debuginfo 2025-06-02 11:08:19 +00:00
Jan Vaclav
4be97207ed tools/nm-in-container: update package install list for fedora 42
- ausearch is part of audit package
- mlocate is not available anymore
- "openvswitch2*" packages are not available anymore
- ipsec-tools is not available anymore
2025-06-02 11:08:19 +00:00
Jan Vaclav
6a4e6fab40 merge: branch 'systemd' into jv/systemd-merge 2025-06-02 10:00:31 +02:00
Íñigo Huguet
b17a842e1a merge: branch 'manpages'
build: make manpages a mandatory part of the build

Closes #1653

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2068
2025-05-30 09:43:14 +00:00
Eli Schwartz
fe62ce6a4b ci: avoid building manpages on Fedora
It appears that xsltproc is not installed there. It is generally needed
for the docs build too, so as a crude CI heuristic, don't build anywhere
that docs are disabled.
2025-05-30 09:42:55 +00:00
Eli Schwartz
a11760ef39 build: make manpages a mandatory part of the build by default
Currently, both man pages and gtk-doc HTML documentation are enabled by
the same build option. It is common for users to want to choose whether
to build HTML docs, as not everyone cares about HTML developer docs, but
manpages are intended directly for end-user consumption and should
always be available. At the very least, there should be a separate
option to disable them to avoid accidentally disabling them while trying
to disable HTML developer docs.

Resolves: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1653
2025-05-30 09:42:55 +00:00
Eli Schwartz
f656675b57 build: install pre-disted manpages if available
When building from a release tarball of NetworkManager,
`meson.add_dist_script()` has copied various prebuilt manpages into the
tarball and building them again is not really necessary. We can just
install those directly.

This means that *all* manpages could be installed even without
introspection, even though some of them can only be *built* when
introspection is enabled.

It also means that manpages can be installed even when xsltproc is not
available at build time.
2025-05-30 09:42:55 +00:00
Eli Schwartz
ee078be745 build: remove outdated, commented-out configure.ac snippet
This was likely added during the port to meson. It's just a multiline
string, so it has no effect in meson, and it appears to be entirely for
things which are already implemented in meson, so there's no real point
in keeping it any longer.
2025-05-30 09:42:55 +00:00
Eli Schwartz
897eed184a build: only demand an xsltproc program when it is used
It's intrinsically used when building manpages, and also part of the
introspection-specific parts of the documentation build. There's no
particular guarantee either of those will actually be invoked during a
build, so don't unconditionally look it up.

This allows building with one fewer dependency in many cases.
2025-05-30 09:42:55 +00:00
Vladimír Beneš
872e626342 release: bump version to 1.55.0 (development) 2025-05-30 11:36:41 +02:00
Vladimír Beneš
20a660110b release: bump version to 1.53.90 (1.54-rc1) 2025-05-30 11:31:37 +02:00
Lubomir Rintel
7ee8d84a1e merge: branch 'lr/ovs-generic'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:46 +02:00
Lubomir Rintel
dcf4bc9241 ovs/factory: fix manager-initiated device creation
The Open VSwitch interfaces have corresponding platform links. When an
Open VSwitch interface is created while NetworkManager is running, the
OVS factory usually sees an OVSDB entry appear first, then creates a
NMDevice. After that, when a platform link appears, the device is
already there.

Upon a (re-)start, the link might be seen first, and then things
go south. The OVS factory rejects the device, which results in Generic
device being created instead. Another device, this time of an
appropriate is created for the same link once the OVSDB entry is seen.

Needless to say, with two NMDevices for the same platform link existing,
no end of mayhem ensues (an assertion is tripped).

Resolves: https://issues.redhat.com/browse/NMT-1634

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:01 +02:00
Lubomir Rintel
f680f23cba manager: note if we see an openvswitch link without a plugin
Add Open VSwitch to link types that are supported by a plugin.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:01 +02:00
Lubomir Rintel
5ef3cfa4d0 ovs/factory: improve logging
Be clearer about the progress of creating the device and ways it can end
up failing.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:01 +02:00
Beniamino Galvani
4ec06e1eaa merge: branch 'dnsconfd-port-fix'
dns: Fix port handling in Dnsconfd plugin

Closes #1765

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2211
2025-05-27 08:49:59 +00:00
Tomas Korbar
75b3f8496b dns: Fix port handling in Dnsconfd plugin
Fixes #1765
2025-05-27 08:24:22 +00:00
Lubomir Rintel
ccd9431e82 device: update L3 if connectivity changes in IP_CHECK/SECONDARIES
If connectivity goes from/to FULL, the penalization of default route metric
may change. For this reason we re-commit L3 configuration if the
connectivity changes while the device is ACTIVATED.

However, there are more device states that need consideration:
IP_CHECK and SECONDARIES, that happen between initial configuration on
IP_CONFIG and removal when the device goes DEACTIVATING.

This should fix the issue encountered here:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2070

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2212
2025-05-22 11:18:36 +02:00
Florian Schmaus
43bcfbcdf5 cli: drop _NMC_RL_STARTUPHOOK_ARGS
Fixes incompatible pointer types warning, which became an error in
newer compilers (e.g., https://bugs.gentoo.org/938249).

Modern libedit versions use the same type signature as readline for
rl_startup_hook, both declare

typedef int	 rl_hook_func_t(void)

This essentially reverts f47d55fc66 ("cli: Fix for rl_startup_hook
function signatures mismatch (-lreadline vs -ledit)").

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2082
2025-05-20 09:54:31 +02:00
Gris Ge
dd7252ff0c merge: branch 'bg/ip-config-crash'
ip-config: fix crash in DNS options evaluation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2210
2025-05-16 15:36:08 +00:00
Beniamino Galvani
c1350f40bd ip-config: fix crash in DNS options evaluation
Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2025-05-16 09:41:03 +02:00
Beniamino Galvani
fd3eccfb16 device: update the external-down unmanaged flag on port attach/release
A device has the "external-down" unmanaged flag when:

  !is-created-by-nm AND (!is-up OR (!has-address AND !is-controller))

When the "is-up" or the "has-address" conditions change, we properly update
the unmanaged flag by calling _dev_unmanaged_check_external_down() in
_dev_l3_cfg_notify_cb(PLATFORM_CHANGE_ON_IDLE).

The "is-controller" condition changes when another link indicates the
current device as controller. We currently don't update the unmanaged flag
when that happens and so it's possible that the device stays unmanaged even
if it has a port. This can be easily reproduced by running this commands:

    ip link add veth0 type veth peer name veth1
    ip link add vrf0 type vrf table 10
    ip link set vrf0 up
    ip link set veth0 master vrf0

Sometimes, the device shows as "unmanaged" instead of "connected
(externally)".

Fix this by re-evaluating the "external-down" unmanaged flags on the
controller when a port is attached or detached.

Fixes: c3586ce01a ('device: consider a device with slaves configured')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2209
2025-05-15 17:22:39 +02:00
Jan Vaclav
3ae6505d7d systemd: update code from upstream (2025-05-05)
This is a direct dump from systemd git.

  $ git clean -fdx && \
    git cat-file -p HEAD | sed '1,/^======$/ d' | bash - && \
    git add .

======

SYSTEMD_DIR=../systemd
COMMIT=a50fa2a40f4a91d49503d3588a3dd29ea05e559b

(
  cd "$SYSTEMD_DIR"
  git checkout "$COMMIT"
  git reset --hard
  git clean -fdx
)

git ls-files -z :/src/libnm-systemd-core/src/ \
                :/src/libnm-systemd-shared/src/ \
                :/src/libnm-std-aux/unaligned-fundamental.h \
                :/src/libnm-std-aux/unaligned.h | \
  xargs -0 rm -f

nm_copy_sd_shared() {
    mkdir -p "./src/libnm-systemd-shared/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-shared/$1"
}

nm_copy_sd_core() {
    mkdir -p "./src/libnm-systemd-core/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-core/$1"
}

nm_copy_sd_stdaux() {
    mkdir -p "./src/libnm-std-aux/"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-std-aux/${1##*/}"
}

nm_copy_sd_core "src/libsystemd-network/dhcp-duid-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-client-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-option.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h"
nm_copy_sd_core "src/libsystemd-network/network-common.c"
nm_copy_sd_core "src/libsystemd-network/network-common.h"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp-duid.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-internal.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-util.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-util.h"
nm_copy_sd_core "src/libsystemd/sd-device/sd-device.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-source.h"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.h"
nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h"
nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c"
nm_copy_sd_core "src/systemd/_sd-common.h"
nm_copy_sd_core "src/systemd/sd-device.h"
nm_copy_sd_core "src/systemd/sd-dhcp-duid.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-client.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-option.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-protocol.h"
nm_copy_sd_core "src/systemd/sd-event.h"
nm_copy_sd_core "src/systemd/sd-id128.h"
nm_copy_sd_core "src/systemd/sd-ndisc.h"
nm_copy_sd_shared "src/basic/alloc-util.c"
nm_copy_sd_shared "src/basic/alloc-util.h"
nm_copy_sd_shared "src/basic/arphrd-util.h"
nm_copy_sd_shared "src/basic/assert-util.h"
nm_copy_sd_shared "src/basic/bitfield.h"
nm_copy_sd_shared "src/basic/btrfs.c"
nm_copy_sd_shared "src/basic/btrfs.h"
nm_copy_sd_shared "src/basic/cgroup-util.h"
nm_copy_sd_shared "src/basic/chase.h"
nm_copy_sd_shared "src/basic/chattr-util.c"
nm_copy_sd_shared "src/basic/chattr-util.h"
nm_copy_sd_shared "src/basic/constants.h"
nm_copy_sd_shared "src/basic/devnum-util.c"
nm_copy_sd_shared "src/basic/devnum-util.h"
nm_copy_sd_shared "src/basic/dns-def.h"
nm_copy_sd_shared "src/basic/env-file.c"
nm_copy_sd_shared "src/basic/env-file.h"
nm_copy_sd_shared "src/basic/env-util.c"
nm_copy_sd_shared "src/basic/env-util.h"
nm_copy_sd_shared "src/basic/errno-util.h"
nm_copy_sd_shared "src/basic/escape.c"
nm_copy_sd_shared "src/basic/escape.h"
nm_copy_sd_shared "src/basic/ether-addr-util.c"
nm_copy_sd_shared "src/basic/ether-addr-util.h"
nm_copy_sd_shared "src/basic/extract-word.c"
nm_copy_sd_shared "src/basic/extract-word.h"
nm_copy_sd_shared "src/basic/fd-util.c"
nm_copy_sd_shared "src/basic/fd-util.h"
nm_copy_sd_shared "src/basic/fileio.c"
nm_copy_sd_shared "src/basic/fileio.h"
nm_copy_sd_shared "src/basic/format-ifname.c"
nm_copy_sd_shared "src/basic/format-ifname.h"
nm_copy_sd_shared "src/basic/format-util.c"
nm_copy_sd_shared "src/basic/format-util.h"
nm_copy_sd_shared "src/basic/fs-util.c"
nm_copy_sd_shared "src/basic/fs-util.h"
nm_copy_sd_shared "src/basic/glyph-util.c"
nm_copy_sd_shared "src/basic/glyph-util.h"
nm_copy_sd_shared "src/basic/hash-funcs.c"
nm_copy_sd_shared "src/basic/hash-funcs.h"
nm_copy_sd_shared "src/basic/hashmap.c"
nm_copy_sd_shared "src/basic/hashmap.h"
nm_copy_sd_shared "src/basic/hexdecoct.c"
nm_copy_sd_shared "src/basic/hexdecoct.h"
nm_copy_sd_shared "src/basic/hostname-util.c"
nm_copy_sd_shared "src/basic/hostname-util.h"
nm_copy_sd_shared "src/basic/in-addr-util.c"
nm_copy_sd_shared "src/basic/in-addr-util.h"
nm_copy_sd_shared "src/basic/inotify-util.c"
nm_copy_sd_shared "src/basic/inotify-util.h"
nm_copy_sd_shared "src/basic/io-util.c"
nm_copy_sd_shared "src/basic/io-util.h"
nm_copy_sd_shared "src/basic/iovec-util.h"
nm_copy_sd_shared "src/basic/label.c"
nm_copy_sd_shared "src/basic/label.h"
nm_copy_sd_shared "src/basic/list.h"
nm_copy_sd_shared "src/basic/locale-util.c"
nm_copy_sd_shared "src/basic/locale-util.h"
nm_copy_sd_shared "src/basic/lock-util.h"
nm_copy_sd_shared "src/basic/log.h"
nm_copy_sd_shared "src/basic/macro.h"
nm_copy_sd_shared "src/basic/memory-util.c"
nm_copy_sd_shared "src/basic/memory-util.h"
nm_copy_sd_shared "src/basic/mempool.c"
nm_copy_sd_shared "src/basic/mempool.h"
nm_copy_sd_shared "src/basic/missing_fcntl.h"
nm_copy_sd_shared "src/basic/missing_fs.h"
nm_copy_sd_shared "src/basic/missing_pidfd.h"
nm_copy_sd_shared "src/basic/missing_random.h"
nm_copy_sd_shared "src/basic/missing_socket.h"
nm_copy_sd_shared "src/basic/missing_syscall.h"
nm_copy_sd_shared "src/basic/missing_wait.h"
nm_copy_sd_shared "src/basic/mountpoint-util.c"
nm_copy_sd_shared "src/basic/mountpoint-util.h"
nm_copy_sd_shared "src/basic/namespace-util.h"
nm_copy_sd_shared "src/basic/ordered-set.c"
nm_copy_sd_shared "src/basic/ordered-set.h"
nm_copy_sd_shared "src/basic/origin-id.h"
nm_copy_sd_shared "src/basic/parse-util.c"
nm_copy_sd_shared "src/basic/parse-util.h"
nm_copy_sd_shared "src/basic/path-util.c"
nm_copy_sd_shared "src/basic/path-util.h"
nm_copy_sd_shared "src/basic/pidfd-util.c"
nm_copy_sd_shared "src/basic/pidfd-util.h"
nm_copy_sd_shared "src/basic/pidref.h"
nm_copy_sd_shared "src/basic/prioq.c"
nm_copy_sd_shared "src/basic/prioq.h"
nm_copy_sd_shared "src/basic/process-util.c"
nm_copy_sd_shared "src/basic/process-util.h"
nm_copy_sd_shared "src/basic/random-util.c"
nm_copy_sd_shared "src/basic/random-util.h"
nm_copy_sd_shared "src/basic/ratelimit.c"
nm_copy_sd_shared "src/basic/ratelimit.h"
nm_copy_sd_shared "src/basic/set.h"
nm_copy_sd_shared "src/basic/sha256.c"
nm_copy_sd_shared "src/basic/sha256.h"
nm_copy_sd_shared "src/basic/signal-util.c"
nm_copy_sd_shared "src/basic/signal-util.h"
nm_copy_sd_shared "src/basic/siphash24.h"
nm_copy_sd_shared "src/basic/socket-util.c"
nm_copy_sd_shared "src/basic/socket-util.h"
nm_copy_sd_shared "src/basic/sort-util.h"
nm_copy_sd_shared "src/basic/sparse-endian.h"
nm_copy_sd_shared "src/basic/stat-util.c"
nm_copy_sd_shared "src/basic/stat-util.h"
nm_copy_sd_shared "src/basic/stdio-util.h"
nm_copy_sd_shared "src/basic/string-table.c"
nm_copy_sd_shared "src/basic/string-table.h"
nm_copy_sd_shared "src/basic/string-util.c"
nm_copy_sd_shared "src/basic/string-util.h"
nm_copy_sd_shared "src/basic/strv.c"
nm_copy_sd_shared "src/basic/strv.h"
nm_copy_sd_shared "src/basic/strxcpyx.c"
nm_copy_sd_shared "src/basic/strxcpyx.h"
nm_copy_sd_shared "src/basic/time-util.c"
nm_copy_sd_shared "src/basic/time-util.h"
nm_copy_sd_shared "src/basic/tmpfile-util.c"
nm_copy_sd_shared "src/basic/tmpfile-util.h"
nm_copy_sd_shared "src/basic/umask-util.h"
nm_copy_sd_shared "src/basic/user-util.c"
nm_copy_sd_shared "src/basic/user-util.h"
nm_copy_sd_shared "src/basic/utf8.c"
nm_copy_sd_shared "src/basic/utf8.h"
nm_copy_sd_shared "src/basic/include/net/if.h"
nm_copy_sd_shared "src/basic/include/netinet/in.h"
nm_copy_sd_shared "src/fundamental/assert-fundamental.h"
nm_copy_sd_shared "src/fundamental/iovec-util-fundamental.h"
nm_copy_sd_shared "src/fundamental/logarithm.h"
nm_copy_sd_shared "src/fundamental/macro-fundamental.h"
nm_copy_sd_shared "src/fundamental/memory-util-fundamental.h"
nm_copy_sd_shared "src/fundamental/sha256-fundamental.c"
nm_copy_sd_shared "src/fundamental/sha256-fundamental.h"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.c"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.h"
nm_copy_sd_shared "src/shared/dns-domain.c"
nm_copy_sd_shared "src/shared/dns-domain.h"
nm_copy_sd_shared "src/shared/log-link.h"
nm_copy_sd_shared "src/shared/web-util.c"
nm_copy_sd_shared "src/shared/web-util.h"
nm_copy_sd_stdaux "src/basic/unaligned.h"
nm_copy_sd_stdaux "src/fundamental/unaligned-fundamental.h"
2025-05-14 12:37:33 +02:00
Íñigo Huguet
892e816a9d merge: branch 'ih/unrealized-parents'
core: virtual devices can be available without a parent

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2203
2025-05-14 05:42:36 +00:00
Íñigo Huguet
94595332c4 core: virtual devices can be available without a parent set
When calling to nm_device_is_available, the device types that requires a
parent like VLAN or MACVLAN checks that their parent exists.

nm_device_is_available is a function to check if the device is available
to activate a connection, so it makes sense that if the parent is not
present it can't be activated.

However, this is wrong for 2 reasons:
1. Most of they are virtual devices that might be unrealized when
   checking its availability. If they're unrealized, their parent hasn't
   been set yet.
2. Even if they're realized, their current parent might not be the one
   that is defined in the connection that is being activated.

This is causing that unrealized devices are not being activated as ports
because nm_manager_get_best_device_for_connection thinks that they are
not available.

Get rid of these checks for the parent in the is_available callbacks.

Fixes: ba86c208e0 ('Revert "core: prevent the activation of unavailable OVS interfaces only"')
Fixes: 774badb151 ('core: prevent the activation of unavailable devices')
2025-05-14 05:42:19 +00:00
Íñigo Huguet
34255b2692 merge: branch 'ih/initrd-fix-bond-ip6'
nm-initrd-generator: fix IPv6 with square brackets in bond options

Closes #1755 and #1731

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2197
2025-05-14 05:36:37 +00:00
Íñigo Huguet
6f6bb17a28 nm-initrd-generator: fix ignored prefix for IPv6 address with brackets
When defining an IPv6 address with square brackets and prefix, like
[dead::beef]/64, the prefix was silently ignored. The address was
accepted only accidentally, because get_word replaced ']' with '\0' so
it resulted in a valid IPv6 address string, but without the prefix.

The previous commit has fixed get_word with better logic to handle the
square brackets, uncovering this issue.

Fix it by explicitly splitting IP addresses and prefixes in
reader_parse_ip so we get a valid address and prefix.

Also, use a prefix different to 64 in the test test_if_ip6_manual. 64 is
the default one, making that the test passed despite the defined prefix
was actually ignored.

Fixes: ecc074b2f8 ('initrd: add command line parser')
2025-05-14 07:35:31 +02:00
Íñigo Huguet
aeaf8ca23c nm-initrd-generator: fix IPv6 with square brackets in bond options
If any bond option contains an IPv6 address it needs to be enclosed with
[]. Otherwise the ':' separators from the IP address can be confused
with the ':' separators from the 'bond=' cmdline arguments.

However, the square brackets were ignored:
    $ nm-initrd-generator -s "bond=bond0:eth0,eth1:ns_ip6_target=[FC08::789:1:0:0:3]"
    NetworkManager-Message: 08:46:55.114: <warn>  [1745498815.1146] cmdline-reader: Ignoring invalid bond option: "ns_ip6_target" = "[FC08": '[FC08' is not a valid IPv6 address for 'ns_ip6_target' option
    NetworkManager-Message: 08:46:55.114: <warn>  [1745498815.1148] cmdline-reader: Ignoring extra: '789:1:0:0:3]'.

The opening '[' was only being considered if it was the first character
in `get_word`. Fix it and consider it if it's in the middle too.

If the brackets are used first and last, directly remove them as it is what
most callers expect. However, if it's in the middle there is no reasonable
way to remove them, so don't do it. Instead, the caller will have to consider
this possibility when processing the content.

Fixes: ecc074b2f8 ('initrd: add command line parser')
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1755
2025-05-14 07:35:31 +02:00
Íñigo Huguet
9e585b6cdc merge: branch 'ih/distros-update'
ci: update supported distros

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2202
2025-05-13 13:30:05 +00:00
Íñigo Huguet
bcbe386823 all: code format 2025-05-13 11:43:33 +02:00
Íñigo Huguet
3d1b55047b ci: update supported distros 2025-05-13 11:39:05 +02:00
Wen Liang
26d4bc9d32 merge: branch 'wl/ethtool_fec_backport_symbol'
libnm: add ethtool fec backported symbols from 1.50.4

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2198
2025-05-06 13:35:39 +00:00
Wen Liang
5b25bc4f9d libnm: add ethtool fec backported symbols from 1.46.8
Add to main branch ethtool fec symbols that were backported to 1.46.8 to
allow seamless upgrading from 1.46 to 1.54.
2025-05-06 13:33:30 +00:00
Wen Liang
799a7a432a libnm: add ethtool fec backported symbols from 1.48.18
Add to main branch ethtool fec symbols that were backported to 1.48.18 to
allow seamless upgrading from 1.48 to 1.54.
2025-05-06 13:33:30 +00:00
Wen Liang
6f1437b79e libnm: add ethtool fec backported symbols from 1.50.4
Add to main branch ethtool fec symbols that were backported to 1.50.4 to
allow seamless upgrading from 1.50 to 1.54.
2025-05-06 13:33:30 +00:00
Vladimír Beneš
64a4c2271a release: bump version to 1.53.4 (development) 2025-05-02 16:46:08 +02:00
Vladimír Beneš
f67ec0ddf4 Revert "release: bump version to 1.53.4 (development)"
This reverts commit 4f849c74b5
2025-05-02 14:43:12 +00:00
Vladimír Beneš
4f849c74b5 release: bump version to 1.53.4 (development) 2025-05-02 16:19:35 +02:00
Beniamino Galvani
d26714481d initrd: fix crash in the NBFT parser
The shared library handle is not initialized when there are no NBFT
entries.

Fixes: 1cb0635d08 ('initrd: add new NBFT parser')
2025-04-30 09:24:50 +02:00
Beniamino Galvani
39b38e5905 merge: branch 'bg/ovs-reapply'
ovs: allow reapplying ovs-bridge and ovs-port properties

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2194
2025-04-29 09:05:49 +00:00
Beniamino Galvani
32ab60f960 device: remove the "can_reapply_change_ovs_external_ids" device field
NMDevices have a special "can_reapply_change_ovs_external_ids" boolean
field indicating whether the device type supports reapplying the
ovs-external-ids and ovs-other-config settings.

Remove this field and use the standard can_reapply_change() method. No
change in behavior is expected.
2025-04-29 11:03:26 +02:00
Beniamino Galvani
4f577d677f ovs: allow reapplying ovs-bridge and ovs-port properties
Allow reapplying the following properties:

 - ovs-bridge.fail-mode
 - ovs-bridge.mcast-snooping-enable
 - ovs-bridge.rstp-enable
 - ovs-bridge.stp-enable
 - ovs-port.bond-downdelay
 - ovs-port.bond-mode
 - ovs-port.bond-updelay
 - ovs-port.lacp
 - ovs-port.tag
 - ovs-port.trunks
 - ovs-port.vlan-mode
2025-04-29 11:03:26 +02:00
Beniamino Galvani
e8e0d43f04 merge: branch 'bg/ovs-bridge-ext-port'
ovs: only keep bridges and ports with NM interfaces attached

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2193
2025-04-29 07:18:27 +00:00
Beniamino Galvani
476c89b6f2 ovs: only keep bridges and ports with NM interfaces attached
If a OVS bridge created via NM has a port created externally, when the
bridge connections goes down then NM detaches the NM-created
port. However, it finds that the bridge still has a port (the external
one) and so it doesn't remove the bridge from ovsdb.

This is a problem, because it means that an explicity deactivation of
the bridge leaves the bridge up. To fix this, only track the number of
port in the bridge actually created by NM. Also, leave alone bridges
not created by NM.
2025-04-29 09:10:52 +02:00
Beniamino Galvani
78a4e5cf3b ovs: slightly improve _delete_interface()
Add comments, and move variables inside the block where they are used.
2025-04-29 09:10:52 +02:00
Beniamino Galvani
0d10c743a5 merge: branch 'nbft-parser-1'
initrd: add new NBFT parser

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2077
2025-04-28 16:44:24 +00:00
Tomas Bzatek
ec917dc670 ci: add libnvme dependency
Required for the nm-initrd-generator NBFT support.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
f0d6b339bf initrd: skip NBFT parsing when already defined on the cmdline
Skip the internal NBFT table parsing when nbft interfaces
are already defined on the cmdline, e.g. from the original
95nvmf dracut module.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
81839c0da8 initrd: workaround zero v6 prefixes for NBFT HFIs
Some firmware implementations incorrectly report v6 address prefix
of zero. Let's use /64 as a sane workaround.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
d38cbfb3d1 initrd: VLAN support for the NBFT parser
Creates additional connections for VLANs, which are in fact
separate HFI records in the NBFT table. Uses MAC address for
linking parent interface as the interface naming is defined
by an external service.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
8b7c6f8b90 initrd: avoid dynamic linking of libnvme, use dlopen() instead
As suggested during the review process, NBFT is niche and most users
won't need it. So keep the initrd generator light and only open
libnvme when any NBFT table is found.

In a typical dracut host-only scenario the nbft dracut module will
be pulled in only when NBFT is present in the system, packing in
nvme-cli and libnvme in the initramfs image.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
1cb0635d08 initrd: add new NBFT parser
The NVMe Boot Firmware Table (NBFT) is a mechanism of passing context
from a pre-OS Boot environment to an OS runtime, as defined by the
NVM Express Boot Specification. Exposed as an ACPI table it contains
network interface definitions along with NVMe subsystem and namespace
data structures.

This adds new nm-initrd-generator parser that uses libnvme NBFT parser
implementation.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Jan Vaclav
03f30ac5cf merge: branch 'jv/po-check'
po: add test to check potfiles list contents

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2190
2025-04-24 10:30:33 +00:00
Jan Vaclav
92c776a88d po: update lists 2025-04-24 10:27:36 +02:00
Jan Vaclav
104be9da87 po: add test to check potfiles list contents
We often forget to add new files to POTFILES, and also
have some paths in the skip file that have not existed
for 15+ years. We should ensure that these files include
the paths that should be there, and nothing more.

This commit adds a test that checks whether all the files
in the po lists exist, and vice versa, that all the files
in the source tree that should be included in this list,
are indeed included in this list.
2025-04-24 10:27:36 +02:00
Beniamino Galvani
e22de07553 merge: branch 'carrier-less-conditions'
device: remove activated condition when the carrier was down

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2189
2025-04-22 16:24:52 +00:00
Friedrich Altheide
c7fc8a4d09 device: remove activated condition when the carrier was down
Call nm_device_update_dynamic_ip_setup every time the carrier was down or was seen down and is now up again, without checking if the state is NM_DEVICE_STATE_ACTIVATED.

Change discussed in https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2173
2025-04-21 19:30:30 +00:00
Beniamino Galvani
87453425ef merge: branch 'dnsconfd_vpn_fix'
dns: Make dnsconfd plugin respect dns-priority

Closes #1748

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2187
2025-04-18 12:32:27 +00:00
Tomas Korbar
e41558e08c dns: Make dnsconfd plugin respect dns-priority
Fixes #1748
2025-04-18 12:14:03 +00:00
Beniamino Galvani
7b2924b762 merge: branch 'bg/ethtool-netlink'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2169
2025-04-17 08:11:54 +02:00
Beniamino Galvani
3fb86182eb README: document the required kernel version
Add a new section in README.md that describes the required Linux
kernel version.
2025-04-17 08:10:54 +02:00
Beniamino Galvani
250475c0fd platform: replace ring ethtool ioctl calls with netlink 2025-04-17 08:10:53 +02:00
Beniamino Galvani
3580dfe517 platform: replace EEE ethtool ioctl calls with netlink 2025-04-17 08:10:51 +02:00
Beniamino Galvani
62c841afcf platform: use the new ethtool-netlink API for pause settings 2025-04-17 08:10:51 +02:00
Beniamino Galvani
79ba228c59 platform: add ethtool netlink implementation
Introduce some basic infrastructure to perform ethtool operations via
netlink. As a proof of concept, implement the pause settings.

Netlink has some advantages over ioctl():

 - it can be easily extended with new attributes;

 - it can return descriptive error messages via the extended ack
   mechanism. For example, when setting the ring parameters to a value
   outside the allowed range, userspace receives error code -EINVAL
   and message "requested ring size exceeds maximum". ioctl() gets
   only -EINVAL, which is shared among many error reasons;

 - since it's possible to specify an ifindex in the request, there are
   no race conditions when the interface name changes;

New ethtool API is available only via netlink; however it makes sense
to start using netlink also for the old API that NM is already using
(pause, eee, rings, etc.) over ioctl() because of the advantages
described above.
2025-04-17 08:10:50 +02:00
Beniamino Galvani
e8a3cd611e platform: move ethtool ioctl functions to a separate file
We're going to replace most of the ioctl-based ethtool functions with
a netlink-based equivalent. Move the ioctl ones to a separate file so
that it's easier to see what still needs to be converted. Also add a
common prefix to the function names.
2025-04-17 08:10:49 +02:00
Beniamino Galvani
88efe48916 libnm-setting: remove unused include 2025-04-17 08:10:49 +02:00
Beniamino Galvani
37785a57e0 platform: use consistent naming for ethtool functions
For unknown reasons (wrong copy and paste?) the getter functions had a
"link" in the name. Remove it.
2025-04-17 08:10:48 +02:00
Íñigo Huguet
a3dd1ef2c7 merge: branch 'ih/fix-ovs-timeout-crash'
core: ovs: fix NULL pointer dereference in ovsdb read timeout callback

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2192
2025-04-16 10:16:02 +00:00
Íñigo Huguet
dc9bf255ee core: ovs: fix NULL pointer dereference in ovsdb read timeout callback
Fixes: f7d321c6d6 ('ovsdb: add watchdog for unparsable JSON data in socket')
2025-04-16 10:15:42 +00:00
Jan Vaclav
b62a0ae7b3 merge: branch 'jv/nmtui-lo'
nmtui: add support for configuring loopback interface

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2175
2025-04-16 07:01:02 +00:00
Jan Vaclav
de56b482f3 nmtui/editor: hide "device" field for loopback connections
This field is irrelevant for this device type, since it will always
be just "lo".
2025-04-15 11:43:06 +00:00
Jan Vaclav
2953200a65 core/devices: generate connections with autoconnect=true
Previously, when a generated connection was edited, and the
machine was rebooted, the connection would not apply, and a
new generated connection would be made, because autoconnect
was set to FALSE.

Set autoconnect to be true by default, so that the modified
generated connection is applied.
2025-04-15 11:43:06 +00:00
Jan Vaclav
f489d213f2 nmtui: add page for configuring loopback interface 2025-04-15 11:43:06 +00:00
Beniamino Galvani
b571e2be5a man: fix syntax to match on connection-id
Fixes: 604c611cd0 ('core: add nm_utils_connection_match_spec_list()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1746
2025-04-15 11:15:02 +02:00
Filip Pokryvka
ec6d122cc9 release: bump version to 1.53.3 (development) 2025-04-14 19:16:15 +02:00
Beniamino Galvani
065fd3e046 merge: branch 'bg/rto-min'
platform: always set the lock flag for RTO_MIN

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2179
2025-04-14 14:43:09 +00:00
Beniamino Galvani
6478e5158a platform: always set the lock flag for RTO_MIN
The rto-min value is ignored by kernel unless the lock flag is set.
2025-04-14 16:41:39 +02:00
Beniamino Galvani
2b922a93a5 platform: accept 0 as valid rto_min value
iproute2 and the kernel accept 0 as valid rto_min value:

  # ip route add 172.16.0.1 dev enp1s0 rto_min 0ms
  # ip route show
  172.16.0.1 dev enp1s0 scope link rto_min lock 0ms

Even if a value of 0ms would not be useful in practice, it is better
to exactly track what kernel reports, instead of assuming that when
the value is zero it is "not set".
2025-04-14 16:41:39 +02:00
Beniamino Galvani
14106431fb libnm-core: set ovs-dpdk and ovs-patch as non-base settings
Settings "ovs-dpdk" and "ovs-patch" are currently marked with priority
NM_SETTING_PRIORITY_HW_BASE, which makes them "base" settings. This
means that they can be used as connection type, for example via "nmcli
connection add type ovs-dpdk ...".

This is wrong, as both settings can only belong to a connection of
type "ovs-interface". Decrease their priority and make them non-base
settings.

The problem was spotted when trying to add a ovs-patch connection via
nmcli:

  # nmcli connection add type ovs-patch ifname p con-name q ovs-patch.peer r controller s port-type ovs-port
  Warning: controller='s' doesn't refer to any existing profile.

  (process:4580): nm-CRITICAL **: 10:15:42.807: file ../src/libnm-core-impl/nm-connection.c: line 1682 (_normalize_ovs_interface_type): should not be reached

  (process:4580): nm-WARNING **: 10:15:42.807: connection did not verify after normalization: ??

  (process:4580): nm-CRITICAL **: 10:15:42.807: file ../src/libnm-core-impl/nm-connection.c: line 2170 (_connection_normalize): should not be reached
  Error: Failed to add 'q' connection: ovs-interface.type: A connection with 'ovs-patch' setting must be of connection.type "ovs-interface" but is "ovs-patch"

Fixes: d0ec501163 ('cli: assert that valid_parts are set for base types')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2178
2025-04-14 13:39:13 +02:00
Beniamino Galvani
37d8945b13 libnm: fix memory leak when parsing IP configuration
When the dictionary contains keys "address" and "uri", the first value
is leaked.

  ==4730== 14 bytes in 1 blocks are definitely lost in loss record 51 of 1,755
  ==4730==    at 0x4841866: malloc (vg_replace_malloc.c:446)
  ==4730==    by 0x4CC5CB9: g_malloc (gmem.c:100)
  ==4730==    by 0x4CDF518: g_strdup (gstrfuncs.c:323)
  ==4730==    by 0x496A6B8: g_strdup_inline (gstrfuncs.h:321)
  ==4730==    by 0x496A6B8: nm_inet_ntop_dup (nm-inet-utils.h:355)
  ==4730==    by 0x496A95B: nm_inet_parse_str (nm-inet-utils.c:539)
  ==4730==    by 0x48AF3A3: _notify_update_prop_nameservers (nm-ip-config.c:179)

Fixes: 4422b14704 ('core, libnm: support per-connection DNS URIs')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2184
2025-04-14 13:36:57 +02:00
Íñigo Huguet
26f2673b90 merge: branch 'ih/nmcli-ovs-port-type'
nmcli: connection: process port-type, type and controller properties first

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2165
2025-04-14 10:08:28 +00:00
Íñigo Huguet
9f6562869b nmcli: improve the warning message about no controller found
When nmcli tries to match a controller it filters by its type. The
controller's type must match with the port's port-type. If no controller
matches, the printed warning was "doesn't refer to any existing
profile". However, the profile might exist, but with wrong type. Improve
the message so it makes that clear.

Fixes: aa12bb353b ('cli: discover slave type for a connection with a master')
2025-04-14 10:08:01 +00:00
Íñigo Huguet
87a5d89f75 nmcli: choose the right port-type for OVS
Normally it is possible not to define port-type in nmcli and it deduces
it from connection.type or connection.controller. Some types like 'bond-slave'
have a single possible value for port-type. In other cases nmcli deduces
the port-type by getting the controller's type, like 'bond'.

For OVS connections, the second method of guessing by the controller's
type was used.  However, in OVS it is common to have different devices
with the same name, causing nmcli to use "ovs-interface" as port-type
if it matched by controller name.

Fix if by deducing the port-type from the connection's type. An ovs-port
connection must always have port-type=ovs-bridge, and an ovs-interface
connection must always have port-type=ovs-port.

Note that this is something that should be done in the daemon, not in
the clients, but this is a small patch that makes it to work in nmcli,
at least. Without this, the mechanism of guessing from the parent would
act, leading to wrong results.

Ideally, all this should be done in the daemon, but currently many
checks in nmcli/libnm depends on having the port-type set, and it
would be lot of work to change it.

Fixes: c5324ed285 ('nmcli: streamline connection addition')
2025-04-14 10:08:01 +00:00
Íñigo Huguet
6a133d10a1 nmcli: connection: don't overwrite port-type if explicitly set
When processing the "type" property we deduce the port-type in some
cases and set it. If the user has chosen a port-type we must not
overwrite it. In any case, we should raise an error when validating the
connection.

Fixes: c5324ed285 ('nmcli: streamline connection addition')
2025-04-14 10:08:01 +00:00
Íñigo Huguet
bb850fda0e nmcli: connection: process port-type, type and controller first
If the connection is a port we need to set the connection.port-type
property. Usually this property is guessed by nmcli depending on the
connection type or the chosen controller, so it doesn't need to be
specified by the user. However, if it is explicitly set by the user
we should not guess, but just use it.

When we process arguments like "controller" or "type" we call custom
functions like set_connection_controller that will guess the port-type
if needed. By processing port-type first, it will be set in the
connection by the time that these other properties are processed, so they
won't try to guess.

After port-type, process connection.type and connection.controller, as we
are usually capable of deducing the port-type from them. Type needs to
be processed first because some types like bond-slave or ovs-port have
only one possible port-type value so we must not try to guess from the
controller.

Fixes: c5324ed285 ('nmcli: streamline connection addition')
2025-04-14 10:08:01 +00:00
Beniamino Galvani
fcf304bbf1 merge: branch 'carrier-down'
device: renew dhcp lease if carrier was down

Closes #1663

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2173
2025-04-14 07:48:44 +00:00
Friedrich Altheide
163c2574d8 device: renew dhcp lease only if carrier was down
Make sure nm_device_update_dynamic_ip_setup is called every time a carrier was down before and the link is now up again.
Previously the dhcp lease was not renewed if the carrier went down and then up again quickly enough.
This led to cases where an old IP was retained even though the device was connected to a different network with a different DHCP server.

This commit introduces device_link_carrier_changed_down

Fixes: d6429d3ddb ('device: ensure DHCP is restarted every time the link goes up')
2025-04-14 07:04:03 +02:00
Lubomir Rintel
fe0b6ad68c merge: branch 'lr/oci-vm-new-conn'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2180
2025-04-11 12:09:49 +02:00
Lubomir Rintel
cb7157f552 test-client: add test for OCI VNIC on VM
Tests that we create a connection for disconnected device.
2025-04-11 11:44:05 +02:00
Lubomir Rintel
c42322bd0d test-client: split up _mock_devices()
The new VM OCI VNIC tests will need to create the devices, but leave one
disconnected.
2025-04-11 11:44:05 +02:00
Lubomir Rintel
39db524d94 test-client: expand MAC addresses from variable
Less literals, more expanded variables. Makes it a little easier to read
for me.
2025-04-11 11:44:05 +02:00
Lubomir Rintel
79b1877c02 test/nm-service: default the devices to DISCONNETED not UNAVAILABLE
It is a little odd that client tests connect "UNAVAILABLE" devices, and
the devices return to "DISCONNECTED" after deactivation.

It differs from what happens in reality, and some client tools
(hey nm-cloud-setup) can break when they rightly assume that the
device is not ready for activation when it's "UNAVAILABLE" not
"DISCONNECTED".
2025-04-11 11:44:05 +02:00
Lubomir Rintel
548e27ef5f cloud-setup: configure disconnected wired devices on OCI
On OCI VMs (virtual machines, as opposed to BM -- bare metal), the VNICs
don't get their addresses via DHCP and need us to get the address from
the metadata and apply it.

https://issues.redhat.com/browse/NMT-1432
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2180
2025-04-11 11:44:05 +02:00
Lubomir Rintel
0540b3c9bc cloud-setup: add a chicken bit variable for creation of new connections
Make it possible to opt in or out of the behavior of creating
connections for disconnected devices. It's not clear why such policy was
in place, and the feature might come useful outside OCI.

Let's add an (undocumented) knob to configure the behavior. We might
remove it (and perhaps make the behaviour default everywhere), or
document and keep it if it turns out we need to use it.
2025-04-11 11:43:28 +02:00
Lubomir Rintel
93960639e8 cloud-setup: factor out creation of new connection
We're going to create connections on wired devices for OCI VM VNICs, and
they're going to also need the same user setting. Factor it out.
2025-04-11 11:43:20 +02:00
Lubomir Rintel
9895540a24 cloud-setup: add device argument to nmcs_add_and_activate()
This will allow us to add & complete connections for existing devices,
such as VNICs on OCI VMs.
2025-04-11 11:43:00 +02:00
Lubomir Rintel
961be7d971 cloud-setup: split up _nmc_skip_connection_by_type()
Split _nmc_skip_connection_by_type() so that we can get a little
more finely grained error reporting.
2025-04-11 11:42:54 +02:00
Íñigo Huguet
95b9b4b678 merge: branch 'ih/coverity'
Fix some defects detected by Coverity

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2174
2025-04-07 14:15:27 +00:00
Íñigo Huguet
9edfc0438c n-dhcp4: fix resource leaks
The function n_dhcp4_c_connection_send_request does not release or take
ownership of its request argument. Because of that, setting it to NULL
in the caller prevents the auto-cleanup of the variable to be executed,
causing a resource leak. Fix it.

Fixes: e23b3c9c3a ('Squashed 'shared/n-dhcp4/' content from commit fb1d43449')
Fixes: 243cc433fb ('n-dhcp4: add new client probe function to send RELEASE message')
2025-04-07 14:15:09 +00:00
Íñigo Huguet
ae7de5b353 core: fix use after free in ping operations
Detected by coverity, the ping_op pointers are used after being freed in
cleanup_ping_operations. Although calling to g_list_remove is probably
safe because it only needs the value of the pointer, not to dereference
it, better to follow best practices. One of the use after free was
actually an error because we dereference ping_op->log_domain.

Fixes: 658aef0fa1 ('connection: Support connection.ip-ping-addresses')
2025-04-07 14:15:09 +00:00
Íñigo Huguet
42edb37499 bond-slb: initialize dest hw address in GARP packets
Detected by Coverity:
    1. NetworkManager-1.53.1/src/core/nm-bond-manager.c:885:5: var_decl: Declaring variable "data" without initializer.
    7. NetworkManager-1.53.1/src/core/nm-bond-manager.c:948:13: uninit_use_in_call: Using uninitialized value "data". Field "data.d_hw_addr" is uninitialized when calling "sendto".
       946|               unaligned_write_ne32(data.s_ip_addr, tmp_addr);
       947|               unaligned_write_ne32(data.d_ip_addr, tmp_addr);
       948|->             if (sendto(sockfd, &data, sizeof(data), 0, (struct sockaddr *) &addr, sizeof(addr)) < 0)
       949|                   return FALSE;
       950|           }

Fixes: 3f2f922dd9 ('bonding: send ARP announcement on bonding-slb link/carrier down')
2025-04-07 14:15:09 +00:00
Lubomir Rintel
cc0222ba01 nmcli/connections: fix build with libedit
This has always been broken (libedit-0:3.1-17.20160618cvs.fc26 is too
old to work and libedit-0:3.1-20.20170329cvs.fc27.x86_64 has this type
mismatch), but new GCC complains (14, 15).

  ../src/nmcli/connections.c: In function ‘nmcli_editor_tab_completion’:
  ../src/nmcli/connections.c:6862:64: error: assignment to ‘void (*)(char **, int,  int)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
   6862 |                             rl_completion_display_matches_hook = uuid_display_hook;
        |                                                                ^
  ../src/nmcli/connections.c:6909:60: error: assignment to ‘void (*)(char **, int,  int)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
   6909 |                         rl_completion_display_matches_hook = uuid_display_hook;
        |                                                            ^

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2172
2025-04-07 15:27:59 +02:00
Herman Semenov
7ab3f0999f nm-cloud-setup: removed excess validation check fields
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2150
2025-04-07 15:25:49 +02:00
Íñigo Huguet
a4401ae0a6 merge: branch 'ih/fec-uninit-var'
core: fail early if we cannot get current FEC value

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2177
2025-04-07 11:05:25 +00:00
Íñigo Huguet
245f0e0b35 core: optimize hash table search in _ethtool_fec_set
Break the loop as soon as we've found the value.

Fixes: 19bed3121f ('ethtool: support Forward Error Correction(fec)')
2025-04-03 09:44:59 +02:00
Íñigo Huguet
cbdd0d9cca core: fail early if we cannot get current FEC value
If we cannot get current FEC value probably we won't be able to set it a
few lines later. Also, if it fails to set, we try to use the value of
the old one that we tried to retrieve without success. In that case, the
variable old_fec_mode would be uninitialized. Fix it by returning early
if we cannot get the current value.

Fixes: 19bed3121f ('ethtool: support Forward Error Correction(fec)')
2025-04-03 09:44:54 +02:00
Beniamino Galvani
355edef8b5 merge: branch 'bg/prefix-delegation'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2162
2025-04-02 17:05:57 +02:00
Beniamino Galvani
b6386b3d27 core: support prefix-delegation.subnet-id 2025-04-02 11:21:59 +02:00
Beniamino Galvani
b372caf0c4 libnm, nmcli: introduce new "prefix-delegation" setting
Introduce a new "prefix-delegation" setting. It contains properties
related to the configuration of downstream interfaces using IPv6
prefix-delegation. The only property at the moment is "subnet-id",
which specifies which prefix to choose when the delegation contains
multiple /64 networks.
2025-04-02 11:21:59 +02:00
Beniamino Galvani
4a8bedcd89 device: remove the prefix-delegation IP configuration on cleanup
When a device in IPv6 shared mode obtains a prefix, it adds a new l3cd
of type L3_CONFIG_DATA_TYPE_PD_6 for that prefix. However, that l3cd
is never removed later and so the address lingers on the interface
even after the connection goes down. Remove the l3cd on cleanup.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
037b14965e libnmc-setting: add new flag for property descriptors
Add a new flag "print_hex_negative_as_base10" in the property
descriptor _NMMetaPropertyTypData.

Normally, when a property has "base = 16", it is printed as unsigned
even if the gtype is signed.

For some properties, we want to print the hexadecimal representation
for positive values, and the base10 representation with minus sign for
negative values. A typical use case is to encode the default value as
"-1" and use positive values as a hexadecimal number.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
dbc4ff0a1d libnm-glib-aux: add nm_ip6_addr_get_subnet_id()
Add function nm_ip6_addr_get_subnet_id() to get the subnet ID of a
IPv6 address.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
4ed1d04aff libnm-glib-aux: add nm_puint64_hash()/nm_puint64_equal()
The two new functions can be used as GHashFunc and GEqualFunc when
creating hash tables whose keys are pointers to a guint64.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
0e4330f2b4 ovs: introduce new "ovs-dpdk.lsc-interrupt" property
Introduce a new "ovs-dpdk.lsc-interrupt", used to configure the Link
State Change (LSC) detection mode.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2149
2025-04-02 11:13:31 +02:00
Beniamino Galvani
4b572a1a4a device: forget about carrier deferred action when ifindex changes
When the carrier of an interface goes down, we defer the handling of
that event by some time (by default 6 seconds), to detect if the
carrier change was a spurious event.

It was observed that in some conditions the carrier goes down and we
register the timer for the deferred action on the device. Then the
link is deleted and recreated. At this point the timer fires and
aborts the new activation of the device.

Once the ifindex changes, cancel the timer for the deferred
carrier-down action.
2025-04-02 10:01:38 +02:00
Beniamino Galvani
ba86c208e0 Revert "core: prevent the activation of unavailable OVS interfaces only"
This was a workaround until the real cause of the issue was found.

This reverts commit a1c05d2ce6.
2025-04-02 10:01:38 +02:00
Wen Liang
40ddff9cc9 merge: branch 'wl/per_iface_ip_forward'
ip-config: Support configuring per-device IPv4 sysctl forwarding option

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2071
2025-04-01 13:43:11 +00:00
Wen Liang
2ad5fbf025 policy: refresh IPv4 forwarding after connection activation and disconnection
Previously, IPv4 shared method will automatically enable the IPv4
global forwarding, all the per-interface level IPv4 forwarding settings
may be changed to match the global setting. Also, all the per-inteface
level forwarding settings can not be restored when deactivating the
shared connection. This is problematic as it may disrupt custom
configurations and lead to inconsistent forwarding behavior across
different network interfaces.

To address this, the implementation now ensures that the original
per-interface forwarding settings are preserved. Upon activating a
shared connection, instead of enabling IPv4 global forwarding
automatically, the per-interface forwarding is enabled on all other
connections unless a connection explicitly has the forwarding set to
"no" in its configuration. Upon deactivating all shared connection,
per-interface forwarding settings are restored to sysctl's default
value. Furthermore, deactivating any connection explicitly sets the
forwarding to sysctl's default value ensuring that network forwarding
behavior remains consistent.
2025-04-01 09:32:46 -04:00
Wen Liang
a8a2e6d727 ip-config: Support configuring per-device IPv4 sysctl forwarding option
Add support for configuring per-interface IPv4 sysctl forwarding setting
in NetworkManager. The feature allows users to configure the
net.ipv4.conf.<interface>.forward setting directly through
NetworkManager, enabling targeted forwarding configurations for
interfaces. This is particularly useful for cases such as enabling
forwarding for MetalLB load balancing without requiring a global
ip_forward=1 setting.

While forwarding setting can be managed via /etc/sysctl.conf,
configuring sysctl options for dynamically created or
software-configured interfaces (e.g., bridges) poses challenges. With
this feature, NetworkManager can configure these settings when
interfaces are created or updated, users no longer need to rely on
nm-dispatcher scripts for per-interface sysctl configuration, which can
be error-prone and complex. This feature ensures a more seamless and
integrated way to manage per-interface forwarding configurations,
reducing user overhead and improving usability in complex network
setups.

We do not support configuring per-device IPv6 sysctl forwarding because
in order to make per-device IPv6 sysctl forwarding work, we also need to
enable the IPv6 global sysctl forwarding setting, but this has potential
security concerns because it changes the behavior of the system to
function as a router, which expose the system to new risks and
unintended traffic flows, especially when enabling forwarding on the
interface the user previously explicitly disabled. Also enabling
per-device IPv6 sysctl setting will change the behavior of router
advertisement (accept_ra), which is not expected. Therefore, we
only support configuring per-device IPv4 sysctl forwarding option in
NetworkManager.

Resolves: https://issues.redhat.com/browse/RHEL-60237
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2071
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1833
2025-04-01 09:32:46 -04:00
Jan Vaclav
5e17b52810 merge: branch 'jv/wg-nftables'
wireguard: add connmark and filtering firewall rules

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2158
2025-04-01 08:09:17 +00:00
Jan Vaclav
2106251e46 firewall/utils: replace ipv4 iptables macro with ipxtables macro 2025-04-01 08:08:52 +00:00
Jan Vaclav
18d5b7d641 firewall/utils: remove _share prefix from iptables_get_name
It's no longer used just for shared mode.
2025-04-01 08:08:52 +00:00
Jan Vaclav
a769c17af7 firewall/wireguard: drop packets received to wrong interface
If we receive a packet sent to the WG interface's address,
but it does not come from the WG tunnel, let's assume something
is broken and drop the packet.

This is also inspired by wg-quick firewall rules:
https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash?id=17c78d31c27a3c311a2ff42a881057753c6ef2a4#n221
2025-04-01 08:08:52 +00:00
Jan Vaclav
db557908a2 wireguard: add firewall rules to copy mark
When a WG connection is connecting to an IPv6 endpoint, configures a
default route, and firewalld is active with IPv6_rpfilter=yes, it never
handshakes and doesn't pass traffic. This is because firewalld has a
IPv6 reverse path filter which is discarding these packets.

Thus, we add some firewall rules whenever a WG connection is brought up
that ensure the conntrack mark and packet mark are copied over.
These rules are largely inspired by wg-quick:

https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash?id=17c78d31c27a3c311a2ff42a881057753c6ef2a4#n221
2025-04-01 08:08:52 +00:00
Jan Vaclav
0f469b30ad build: add path definition for ip6tables 2025-04-01 08:08:52 +00:00
Jan Vaclav
10c2892d57 firewall/utils: move logs from sharing to firewall domain 2025-04-01 08:08:52 +00:00
Jan Vaclav
e39e119636 firewall/utils: fix ntf -> nft typo
Fixes: 4badc1f33a ('firewall: fix signalling timeout error reason from _fw_nft_call()')
2025-04-01 08:08:52 +00:00
Herman Semenov
3aa6e689ec libnm-platform: fix not set MACVTAP when cache ops added or updated
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2151
2025-03-31 14:58:45 +02:00
Beniamino Galvani
7f381c9d68 merge: branch 'wip/jtojnar/pygobject-3.52-docs'
meson: Fix docs generation with PyGObject 3.52

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2164
2025-03-31 12:08:38 +00:00
Jan Tojnar
12eff9a7fd meson: Fix docs generation with PyGObject 3.52
PyGObject 3.52 switched from gobject-introspection’s libgirepository 1.0
to glib’s libgirepository 2.0. As a result, the Python script would
no longer be able to find the `GIRepository` 2.0 typelib:

    (process:1944): GLib-GIRepository-DEBUG: 15:25:14.521: Ignoring GIRepository-2.0.typelib because this libgirepository corresponds to GIRepository-3.0.typelib

We could update the script to support both versions of the typelib
but it is not really necessary. It was only used to add extra directories
from `$LD_LIBRARY_PATH` and the CLI argument to repository’s library path
but libgirepository already supports using `LD_LIBRARY_PATH` directly:
https://docs.gtk.org/girepository/method.Repository.prepend_library_path.html
2025-03-31 12:04:43 +00:00
Beniamino Galvani
ecce8fa461 vpn: fix logging message
Fixes: c4a7d6a06f ('vpn: honor the ipvX.method connection property')
2025-03-31 13:39:07 +02:00
Beniamino Galvani
ba0474ef06 merge: branch 'pr/2147'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2147
2025-03-31 10:02:43 +02:00
Michael Biebl
b5c81a9070 Regenerate files so it matches the expected output 2025-03-27 14:52:00 +01:00
Michael Biebl
0e83c595f3 Rephrase certain expressions to avoid the usage of the term "allows to" 2025-03-27 09:44:07 +01:00
Michael Biebl
898db303c3 typo fix: allow to -> allow one to
Detected by lintian:

Example:
I: network-manager: typo-in-manual-page "allow to" "allow one to" [usr/share/man/man5/NetworkManager.conf.5.gz:1392]
2025-03-26 19:22:56 +01:00
Michael Biebl
10e58f7c3c typo fix: allows to -> allows one to
Detected by lintian:

Example:
I: network-manager: typo-in-manual-page "allows to" "allows one to" [usr/share/man/man5/NetworkManager.conf.5.gz:1266]
2025-03-26 19:22:01 +01:00
Michael Biebl
a98d85af93 typo fix: succesfully -> successfully
Detected by lintian:
I: network-manager: spelling-error-in-binary succesfully successfully [usr/sbin/NetworkManager]
2025-03-26 18:38:56 +01:00
Beniamino Galvani
5ed963e054 build: remove -flto-partition=none when building with GCC
Older versions of GCC (< 12) have issues building NM with LTO because
they drop libnm symbols added via '_asm__(".symver " ...)', which we
use to support symbols backported to older versions of the DSO.

Nowadays, GCC supports a new "__symver__" attribute that is
LTO-friendly; use that when possible and remove the
-flto-partition=none hack, as it increases memory usage when
compiling.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1714
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2142
2025-03-26 09:25:53 +01:00
Beniamino Galvani
481afec6ea release: fix validation of gitlab token
If the token is wrong or expired, the command still returns
success. Check the content of the reply instead.

Fixes: f05192ada8 ('release.sh: release to freedesktop.org, not to GNOME')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2148
2025-03-25 14:35:55 +01:00
Beniamino Galvani
ea0be49451 merge: branch 'bg/secret-agent-gi'
examples: add secret agent example in python/gi

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2166
2025-03-25 13:34:33 +00:00
Beniamino Galvani
eb24d7cf03 examples: add secret agent example in python/gi
Add an example of a simple secret agent written in Python using
GObject introspection.
2025-03-25 14:32:27 +01:00
Beniamino Galvani
c01168f4f9 libnm: fix GObject introspection annotations for NMSecretAgentOld
Add some missing "(nullable)" annotations to parameters of the
callback functions in NMSecretAgentOld. Otherwise, PyGObject complains
that those parameters cannot be NULL when implementing a secret agent.

Fixes: d595f7843e ('libnm: add libnm/libnm-core (part 1)')
2025-03-25 14:31:26 +01:00
Piotr Drąg
e51de3750e po: Update POTFILES.in and POTFILES.skip
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2154
2025-03-25 11:19:14 +01:00
Íñigo Huguet
050f4e6500 merge: branch 'ih/sl-po'
po: Update Slovenian (sl) po file

Closes #1716

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2156
2025-03-24 14:35:54 +00:00
Íñigo Huguet
b68d25af9b po: Update Slovenian (sl) po file
Contributed-by: @filmsi (https://gitlab.freedesktop.org/filmsi)
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1716
2025-03-24 14:32:04 +00:00
Íñigo Huguet
23e42cb73a merge: branch 'ih/fix-lacp-msg'
bond: fix wrong property name in error message

Closes #1720

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2157
2025-03-24 14:31:46 +00:00
Íñigo Huguet
95de3bee86 bond: fix wrong property name in error message
Contributed-by: Jiří Boháč (https://gitlab.freedesktop.org/jbohac)
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1720
2025-03-24 14:30:51 +00:00
Íñigo Huguet
45e7e158c1 merge: branch 'ih/nmcli-complete'
nmcli: fix argument completion if nmcli is aliased

Closes #1734

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2159
2025-03-24 14:29:42 +00:00
Íñigo Huguet
78f179b53e nmcli: fix argument completion if nmcli is aliased
If an alias like `nmcli=nmcli --some-arguments` is used, bash completion
doesn't work. Fix it by using `command nmcli` from the nmcli-completion
script, so we ensure that the --complete-args is passed directly to
nmcli binary, not through an alias.

Contributed-by: Jonas Belouadi (@potamides)
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1734
2025-03-24 14:29:19 +00:00
Íñigo Huguet
8b8fc44b19 merge: branch 'ih/macvlan-promisc'
libnm: macvlan: specify that promiscuous affects to the parent

Closes #1732

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2160
2025-03-24 14:18:41 +00:00
Íñigo Huguet
1fdcfb7abe libnm: macvlan: specify that promiscuous affects to the parent
Fixes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1732
Fixes: 4d0192e661 ('libnm-core: add NMSettingMacvlan')
2025-03-24 15:16:04 +01:00
Vladimír Beneš
0d76bec4de release: bump version to 1.53.2 (development) 2025-03-24 11:26:04 +01:00
Beniamino Galvani
a0ff8d20f0 merge: branch 'dnsconfd_plugin_fixes'
dns: Fix invalid memory access on Dnsconfd DBUS error

Closes #1738

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2161
2025-03-24 08:14:50 +00:00
Tomas Korbar
7ba27f7a13 dns: Refactor changing of Dnsconfd plugin state 2025-03-24 07:56:26 +00:00
Tomas Korbar
4ad20787bb dns: Fix invalid memory access on Dnsconfd DBUS error
DBus errors were not properly handled after DBus calls and
that caused SIGSEGV. Now they are checked.

Fixes #1738
Fixes: b8714e86e4 ('dns: introduce configuration_serial support to the dnsconfd plugin')
2025-03-24 07:56:26 +00:00
Íñigo Huguet
42349205dd merge: branch 'ff/makerepo_f40'
contrib/makerepo.sh: fix script for fedpkg 1.44

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2124
2025-03-12 09:17:05 +00:00
Fernando Fernandez Mancera
b281ae0c22 contrib/makerepo.sh: fix script for fedpkg 1.44
If the user of the script still uses fedpkg 1.44 the script fails
because the -build directory doesn't exist.

Now it was tested in both versions.
2025-03-12 09:16:50 +00:00
Jan Vaclav
63b81d893e merge: branch 'jv/accept-localhost-persistent'
policy: accept localhost hostnames if statically configured

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2114
2025-03-12 09:00:56 +00:00
Jan Vaclav
152d71a1f1 policy: accept localhost hostnames if static
Prevents NetworkManager from trying to determine the
transient hostname via DHCP or other means if "localhost"
is already configured as a static hostname, as the transient
hostname will be ignored by hostnamed if a static hostname
has already been set.
2025-03-11 09:26:20 +00:00
Jan Vaclav
21c46d6e5f libnm-glib-aux: add nm_utils_is_not_empty_hostname
Checks whether the hostname is not empty or "(none)".
2025-03-11 09:26:20 +00:00
Beniamino Galvani
6292b0c9dc version: add version 1.54 macros 2025-03-06 18:45:23 +01:00
Íñigo Huguet
dc51ffe857 NEWS: update the 1.52 to match nm-1-52 2025-03-04 08:49:18 +01:00
Íñigo Huguet
a60ca31fd9 spec: specify paths to *-initrd.service files from the buildroot
Fixes: 91e36ea214 ('spec: don't install *-initrd.services')
2025-03-04 07:19:56 +01:00
Íñigo Huguet
91e36ea214 spec: don't install *-initrd.services
They cannot be used yet as Dracut need changes. They are not really
tested, neither, so better not to install them as they might cause
confusion about their purpose.
2025-03-03 15:42:36 +01:00
Íñigo Huguet
bf1a8ce5d4 release: bump version to 1.53.1 (development) 2025-02-28 15:45:29 +01:00
Íñigo Huguet
995a28fa1c release: bump version to 1.52.0 2025-02-28 14:55:33 +01:00
Íñigo Huguet
f275a4d08a contrib/build: ignore missing signingkey in git config
Fixes: 64f8ec6099 ('rpm/build*.sh: trap failures')
(cherry picked from commit 90c403f4ef)
2025-02-28 14:34:48 +01:00
Íñigo Huguet
90c403f4ef contrib/build: ignore missing signingkey in git config
Fixes: 64f8ec6099 ('rpm/build*.sh: trap failures')
2025-02-28 14:33:18 +01:00
Íñigo Huguet
1e89a05a20 CI: update images 2025-02-28 14:21:35 +01:00
Lubomir Rintel
837cf2e6e4 gitlab/fedora-install: use yum install --allowerasing
This allows us to drag in packages that replace something in the base
image. Notably, this fixes installing pppd on Fedora 42 that requires
systemd (whereas the image has conflicting systemd-standalone-sysusers).

(cherry picked from commit 979717df4e)
2025-02-28 14:21:19 +01:00
Lubomir Rintel
726e0a5aee fedora/REQUIRED_PACKAGES: remove very old optional package names
Attempting to install these takes time and they are no longer there
since ancient times. CentOS 9 and later are fine.

(cherry picked from commit 39efc8a394)
2025-02-28 14:21:19 +01:00
Lubomir Rintel
3982c5a04d Revert "fedora/REQUIRED_PACKAGES: speed up optional packages installation"
dnf --skip-unavailable not available on CentOS 9.

This reverts commit 5409d4f5cd.

(cherry picked from commit e2aa19a06c)
2025-02-28 14:21:19 +01:00
Lubomir Rintel
57f9d99b8a contrib: drop old gtkdoc patch
This has been integrated 6 years ago.

(cherry picked from commit 054962aeea)
2025-02-28 14:21:19 +01:00
Lubomir Rintel
81f272babe contrib/build: ignore initial failure to set $SOURCE
More fallout from set -e patch, encountered during a release.

Fixes: 64f8ec6099 ('rpm/build*.sh: trap failures')
(cherry picked from commit aea231f489)
2025-02-28 09:43:38 +01:00
Íñigo Huguet
815b3f5885 NEWS: update for 1.52 release 2025-02-28 09:40:55 +01:00
Lubomir Rintel
a0779a9339 keyfile: don't crash on failure to write
The log statement ended up using wrong (always NULL) connection to get
ID from. Fix.

Resolves: https://issues.redhat.com/browse/RHEL-77157
(cherry picked from commit a7cf9d399f)
2025-02-28 09:18:26 +01:00
Lubomir Rintel
5c16bb1d26 Reapply "client/test: add test for VLANs on OCI"
This reverts commit a852b79cf5f783dccff738152d238f93bb956cc8.

(cherry picked from commit 70872cbb38)
2025-02-26 13:30:08 +01:00
Lubomir Rintel
68d7e17737 Reapply "cloud-setup: create VLANs for multiple VNICs on OCI"
The idea is to create a pair of VLAN and MACVLAN with AddAndActivate if
they are not present, and otherwise follow the ordinary (GetApplied &
Reapply) procedure if the devices are already present.

This reverts commit 87d7ccc5807011fe74aa653677f142c31b54329f.

(cherry picked from commit 7eee669217)
2025-02-26 13:30:04 +01:00
Lubomir Rintel
369db80086 Reapply "cloud-setup: lookup device by MAC + type instead of just MAC"
This will be useful for updating configuration of Vlans and MacVlans,
some of having same MAC addresses as devices of other type.

This reverts commit cee0515f1399fe05f650adec147435aa0a933d78.

(cherry picked from commit 6cedd594b6)
2025-02-26 13:30:00 +01:00
Lubomir Rintel
fd6f4f86e4 Reapply "cloud-setup: parse OCI metadata related to VLAN config"
Baremetal instances in Oracle Cloud require special VLAN config. Parse
the metadata related to it.

This reverts commit 5eefd2d59c.

(cherry picked from commit 5c3efeef15)
2025-02-26 13:29:57 +01:00
Lubomir Rintel
b7114d00ed Reapply "manager: create virtual devices on AddAndActivate()"
This reverts commit ccae5dc0e29be145ce4f7ea193c29f2234097f2e.

(cherry picked from commit 11045cfa00)
2025-02-26 13:29:53 +01:00
Lubomir Rintel
4a1c51317e manager: make system_create_virtual_device() return a GError
This is done so that AddAndActivate() will return sensible errors in a
future patch that makes it support creating virtual devices.

In effect, all errors are logged in one place, therefore the log levels
are different. I don't think we're losing anything of value by being
a little less verbose here.

(cherry picked from commit 45d82f720c)
2025-02-26 13:29:49 +01:00
Lubomir Rintel
4a8e672506 merge: branch 'lr/sw-device-cleanup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2126
2025-02-26 11:06:13 +01:00
Lubomir Rintel
70872cbb38 Reapply "client/test: add test for VLANs on OCI"
This reverts commit a852b79cf5f783dccff738152d238f93bb956cc8.
2025-02-26 11:05:19 +01:00
Lubomir Rintel
7eee669217 Reapply "cloud-setup: create VLANs for multiple VNICs on OCI"
The idea is to create a pair of VLAN and MACVLAN with AddAndActivate if
they are not present, and otherwise follow the ordinary (GetApplied &
Reapply) procedure if the devices are already present.

This reverts commit 87d7ccc5807011fe74aa653677f142c31b54329f.
2025-02-26 11:05:19 +01:00
Lubomir Rintel
6cedd594b6 Reapply "cloud-setup: lookup device by MAC + type instead of just MAC"
This will be useful for updating configuration of Vlans and MacVlans,
some of having same MAC addresses as devices of other type.

This reverts commit cee0515f1399fe05f650adec147435aa0a933d78.
2025-02-26 11:05:19 +01:00
Lubomir Rintel
5c3efeef15 Reapply "cloud-setup: parse OCI metadata related to VLAN config"
Baremetal instances in Oracle Cloud require special VLAN config. Parse
the metadata related to it.

This reverts commit 5eefd2d59c.
2025-02-26 11:05:08 +01:00
Lubomir Rintel
11045cfa00 Reapply "manager: create virtual devices on AddAndActivate()"
This reverts commit ccae5dc0e29be145ce4f7ea193c29f2234097f2e.
2025-02-26 11:05:08 +01:00
Lubomir Rintel
45d82f720c manager: make system_create_virtual_device() return a GError
This is done so that AddAndActivate() will return sensible errors in a
future patch that makes it support creating virtual devices.

In effect, all errors are logged in one place, therefore the log levels
are different. I don't think we're losing anything of value by being
a little less verbose here.
2025-02-26 11:05:08 +01:00
Beniamino Galvani
1b4372a9be merge: branch 'initrd-services'
systemd: add initrd-specific services

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2089
2025-02-26 09:32:30 +00:00
Antonio Alvarez Feijoo
8640ea822f systemd: add initrd-specific services
Decouple from a specific initrd generator (dracut) the systemd services that
provide networking in the initrd using NM, thus allowing other systemd-based
initrd generators to take advantage of it.

These new services are:
- `NetworkManager-config-initrd.service`: it starts very early at boot, parses
the kernel command line using `nm-initrd-generator` and sets the
`/run/NetworkManager/initrd/neednet` flag to activate the other initrd services,
and also sets the hostname if needed.
- `NetworkManager-initrd.service`: it basically does the same job as the
`NetworkManager.service`, but in the initrd.
- `NetworkManager-wait-online-initrd.service`: ordered before
`network-online.target`, it will allow other services that require networking to
delay their start until NM has finished.
2025-02-26 09:31:05 +00:00
Íñigo Huguet
a90efe91ad merge: branch 'lr/skip-broken'
Various CI/build fixes

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2135
2025-02-25 09:55:08 +00:00
Lubomir Rintel
cafb841a29 CI: update images 2025-02-25 09:38:49 +00:00
Lubomir Rintel
979717df4e gitlab/fedora-install: use yum install --allowerasing
This allows us to drag in packages that replace something in the base
image. Notably, this fixes installing pppd on Fedora 42 that requires
systemd (whereas the image has conflicting systemd-standalone-sysusers).
2025-02-25 09:38:49 +00:00
Lubomir Rintel
39efc8a394 fedora/REQUIRED_PACKAGES: remove very old optional package names
Attempting to install these takes time and they are no longer there
since ancient times. CentOS 9 and later are fine.
2025-02-25 09:38:49 +00:00
Lubomir Rintel
e2aa19a06c Revert "fedora/REQUIRED_PACKAGES: speed up optional packages installation"
dnf --skip-unavailable not available on CentOS 9.

This reverts commit 5409d4f5cd.
2025-02-25 09:38:49 +00:00
Lubomir Rintel
054962aeea contrib: drop old gtkdoc patch
This has been integrated 6 years ago.
2025-02-25 09:38:49 +00:00
Lubomir Rintel
aea231f489 contrib/build: ignore initial failure to set $SOURCE
More fallout from set -e patch, encountered during a release.

Fixes: 64f8ec6099 ('rpm/build*.sh: trap failures')
2025-02-25 09:38:49 +00:00
Íñigo Huguet
8f2f86e0f0 merge: branch 'main'
po: Update Georgian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2140
2025-02-25 09:36:25 +00:00
NorwayFun
af8b74ab2a po: Update Georgian translation 2025-02-25 09:35:54 +00:00
Íñigo Huguet
26a5eb0d98 merge: branch 'bg/check-domain-utf8'
core: discard non UTF-8 search domains

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2145
2025-02-25 09:29:30 +00:00
Beniamino Galvani
14a521ac9b core: discard non UTF-8 search domains
Domains are exported via D-Bus and so they must be valid UTF-8.

RFC 1035 specifies that domain labels can contain any 8 bit values,
but also recommends that they follow the "preferred syntax" which only
allows letters, digits and hypens.

Don't introduce a strict validation of the preferred syntax, but at
least discard non UTF-8 search domains, as they will cause assertion
failures later when they are sent over D-Bus.
2025-02-25 09:29:05 +00:00
Íñigo Huguet
949c7b84a3 policy: fix unitialized variable
The variable 'change' may be used uninitialized.

Fixes: 7acc66699a ('policy: always reset retries when unblocking children or ports')
(cherry picked from commit af6aca3527)
2025-02-24 16:47:19 +01:00
Beniamino Galvani
bc6248a3eb merge: branch 'bg/mptcp-endpoints'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2141

(cherry picked from commit 472a7b48e8)
2025-02-24 09:07:54 +01:00
Beniamino Galvani
ceef38d9a5 l3cfg: only add MPTCP endpoints for non-tentative IPv6 addresses
An IPv6 endpoint is not usable until the address is non-tentative. Add
a mechanism to wait until the address is ready.

(cherry picked from commit 227cd6307b)
2025-02-24 09:07:54 +01:00
Beniamino Galvani
2c5a51201d l3cfg: wait for the address before configuring an MPTCP endpoint
Skip the configuration of the MPTCP endpoint when the address is in
the l3cd but is not yet configured in the platform. This typically
happens when IPv4 DAD is enabled and the address is being probed.

If we configure the endpoint without the address set, the kernel will
try to use the endpoint immediately but it will fail. Then, the
endpoint will not be used ever again after the address is added.

(cherry picked from commit 6bf859af79)
2025-02-24 09:07:54 +01:00
Beniamino Galvani
a301c259f2 core: split nm_netns_watcher_remove_all()
The name suggests that the function always removes all the watchers
with the given tag; instead it removes only "dirty" ones when the
"all" parameter is FALSE. Split the function in two variants.

(cherry picked from commit b6e67c6abc)
2025-02-24 09:07:53 +01:00
Beniamino Galvani
472a7b48e8 merge: branch 'bg/mptcp-endpoints'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2141
2025-02-24 08:56:27 +01:00
Beniamino Galvani
227cd6307b l3cfg: only add MPTCP endpoints for non-tentative IPv6 addresses
An IPv6 endpoint is not usable until the address is non-tentative. Add
a mechanism to wait until the address is ready.
2025-02-24 08:55:53 +01:00
Beniamino Galvani
6bf859af79 l3cfg: wait for the address before configuring an MPTCP endpoint
Skip the configuration of the MPTCP endpoint when the address is in
the l3cd but is not yet configured in the platform. This typically
happens when IPv4 DAD is enabled and the address is being probed.

If we configure the endpoint without the address set, the kernel will
try to use the endpoint immediately but it will fail. Then, the
endpoint will not be used ever again after the address is added.
2025-02-24 08:55:53 +01:00
Beniamino Galvani
b6e67c6abc core: split nm_netns_watcher_remove_all()
The name suggests that the function always removes all the watchers
with the given tag; instead it removes only "dirty" ones when the
"all" parameter is FALSE. Split the function in two variants.
2025-02-24 08:55:53 +01:00
Lubomir Rintel
a7cf9d399f keyfile: don't crash on failure to write
The log statement ended up using wrong (always NULL) connection to get
ID from. Fix.

Resolves: https://issues.redhat.com/browse/RHEL-77157
2025-02-24 06:52:35 +01:00
Tomas Korbar
39b7a8df91 dns: fix Dnsconfd autostart
When Dnsconfd service is enabled but not started, NetworkManager
should attempt to start it through DBus at least once.

Fixes: c6e1925dec ('dns: Add dnsconfd DNS plugin')
(cherry picked from commit 1463b1c0a3)
2025-02-20 19:02:25 +01:00
Beniamino Galvani
2ee54e66c3 merge: branch 'dnsconfd_autostart_fix'
Fix Dnsconfd autostart

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2144
2025-02-20 18:01:39 +00:00
Tomas Korbar
1463b1c0a3 dns: fix Dnsconfd autostart
When Dnsconfd service is enabled but not started, NetworkManager
should attempt to start it through DBus at least once.

Fixes: c6e1925dec ('dns: Add dnsconfd DNS plugin')
2025-02-20 17:55:41 +00:00
Beniamino Galvani
5aafbb9bf8 NEWS: update for 1.54 (development) 2025-02-20 14:15:28 +01:00
Jan Vaclav
4f6a057a09 nmcli: print to stderr where appropriate
Currently, nmcli logs a lot of error messages to stdout rather
than stderr. Make it so that stderr is used whenever it makes
sense.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2108
2025-02-20 09:13:01 +00:00
Íñigo Huguet
462b4172b2 merge: branch 'ih/autocon_ports_uninit'
policy: fix unitialized variable

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2143
2025-02-20 06:42:20 +00:00
Íñigo Huguet
af6aca3527 policy: fix unitialized variable
The variable 'change' may be used uninitialized.

Fixes: 7acc66699a ('policy: always reset retries when unblocking children or ports')
2025-02-20 06:41:50 +00:00
Kyle Ouellette
42b95fad79 ndisc: ignore IPv6 RA PIOs if preferred lifetime > valid lifetime
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2117
2025-02-18 15:56:04 +01:00
Fernando Fernandez Mancera
b8ef2a551e core: prevent the activation of unavailable OVS interfaces only
Preventing the activation of unavailable devices for all device types is
too aggresive and leads to race conditions, e.g when a non-virtual bond
port gets a carrier, preventing the device to be a good candidate for
the connection.

Instead, enforce this check only on OVS interfaces as NetworkManager
just makes sure that ovsdb->ready is set to TRUE.

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

Fixes: 774badb151 ('core: prevent the activation of unavailable devices')
(cherry picked from commit a1c05d2ce6)
2025-02-18 12:29:19 +01:00
Jan Vaclav
8e78a8c28f nmtui/ipv6: add "shared" method to ipv6 options
It was previously only available for IPv4, and the option
was missing from the IPv6 methods.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2138
(cherry picked from commit e983e8a46f)
2025-02-18 12:11:28 +01:00
Jan Vaclav
e983e8a46f nmtui/ipv6: add "shared" method to ipv6 options
It was previously only available for IPv4, and the option
was missing from the IPv6 methods.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2138
2025-02-18 12:09:03 +01:00
Fernando Fernandez Mancera
077ffcc0ea policy: unify logs formatting to use NM_HASH_OBFUSCATE_PTR
Having these hashes around are really useful when debugging issues. In
nm-policy we were using the pointer directly which is wrong as they are
not used in other places.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2133
2025-02-18 12:01:17 +01:00
Fernando Fernandez Mancera
a1c05d2ce6 core: prevent the activation of unavailable OVS interfaces only
Preventing the activation of unavailable devices for all device types is
too aggresive and leads to race conditions, e.g when a non-virtual bond
port gets a carrier, preventing the device to be a good candidate for
the connection.

Instead, enforce this check only on OVS interfaces as NetworkManager
just makes sure that ovsdb->ready is set to TRUE.

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

Fixes: 774badb151 ('core: prevent the activation of unavailable devices')
2025-02-18 11:54:57 +01:00
Fernando Fernandez Mancera
2daeef668d policy: always reset retries when unblocking children or ports
When calling activate_port_or_children_connections() we are unblocking
the ports and children but we are not resetting the number of retries if
it is an internal activation.

This is wrong as even if it's an internal activation the number of
retries should be reset. It won't interferfe with other blocking reasons
like USER_REQUESTED or MISSING_SECRETS.

(cherry picked from commit 7acc66699a)
2025-02-13 12:03:05 +01:00
Beniamino Galvani
d29d591d06 merge: branch 'bg/dnsconfd-fix-pending'
Some fixes for the dnsconfd plugin

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

(cherry picked from commit 006a3fb51a)
2025-02-13 10:38:35 +01:00
Beniamino Galvani
5e18da31a4 dnsconfd: drop "connection-*" entries from the update method
Stop passing "connection-*" entries in the update method to
dnsconfd. The plugin tries to determine the connection from the
ifindex, but it's not possible to do it right at the moment because
the same ifindex can be used at the same time e.g. by a policy-based
VPN like ipsec and a normal device. Instead, it should be NM that
explicitly passes the information about the connection to the DNS
plugin. Anyway, these variables are not used at the moment by
dnsconfd.

Fixes: c6e1925dec ('dns: Add dnsconfd DNS plugin')
(cherry picked from commit 4d84e6cddf)
2025-02-13 10:38:34 +01:00
Beniamino Galvani
e20794989b dnsconfd: set the state to idle when connection fails
If the plugin can't connect to D-Bus, it is not waiting for an update;
set the state to idle.

(cherry picked from commit 2bfd27f74d)
2025-02-13 10:38:34 +01:00
Beniamino Galvani
dc0ff10efb dnsconfd: fix handling of the update-pending flag
After every state change of the plugin there should be an invocation
of _nm_dns_plugin_update_pending_maybe_changed() to re-evaluate
whether we are waiting for an update. send_dnsconfd_update() doesn't
change the state and so there is need to check again afterwards.

(cherry picked from commit 8ff1cbf38b)
2025-02-13 10:38:34 +01:00
Beniamino Galvani
006a3fb51a merge: branch 'bg/dnsconfd-fix-pending'
Some fixes for the dnsconfd plugin

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2137
2025-02-13 09:37:24 +00:00
Beniamino Galvani
4d84e6cddf dnsconfd: drop "connection-*" entries from the update method
Stop passing "connection-*" entries in the update method to
dnsconfd. The plugin tries to determine the connection from the
ifindex, but it's not possible to do it right at the moment because
the same ifindex can be used at the same time e.g. by a policy-based
VPN like ipsec and a normal device. Instead, it should be NM that
explicitly passes the information about the connection to the DNS
plugin. Anyway, these variables are not used at the moment by
dnsconfd.

Fixes: c6e1925dec ('dns: Add dnsconfd DNS plugin')
2025-02-13 10:36:08 +01:00
Beniamino Galvani
2bfd27f74d dnsconfd: set the state to idle when connection fails
If the plugin can't connect to D-Bus, it is not waiting for an update;
set the state to idle.
2025-02-13 10:36:08 +01:00
Beniamino Galvani
8ff1cbf38b dnsconfd: fix handling of the update-pending flag
After every state change of the plugin there should be an invocation
of _nm_dns_plugin_update_pending_maybe_changed() to re-evaluate
whether we are waiting for an update. send_dnsconfd_update() doesn't
change the state and so there is need to check again afterwards.
2025-02-13 10:36:08 +01:00
Fernando Fernandez Mancera
7acc66699a policy: always reset retries when unblocking children or ports
When calling activate_port_or_children_connections() we are unblocking
the ports and children but we are not resetting the number of retries if
it is an internal activation.

This is wrong as even if it's an internal activation the number of
retries should be reset. It won't interferfe with other blocking reasons
like USER_REQUESTED or MISSING_SECRETS.
2025-02-12 16:26:50 +01:00
Filip Pokryvka
b2f7f3950d release: bump version to 1.53.0 (development) 2025-02-12 13:31:51 +01:00
Filip Pokryvka
5749633729 release: bump version to 1.51.90 (1.52-rc1) 2025-02-12 13:27:22 +01:00
Filip Pokryvka
bb8bb65216 NEWS: update 2025-02-12 12:56:23 +01:00
Beniamino Galvani
fbd87bf961 merge: branch 'bg/autoconnect-ports-ovs'
Fix autoconnect-ports for OVS interfaces

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2131
2025-02-12 08:54:02 +00:00
Beniamino Galvani
774badb151 core: prevent the activation of unavailable devices
When autoconnecting ports of a controller, we look for all candidate
(device,connection) tuples through the following call trace:

 -> autoconnect_ports()
   -> find_ports()
     -> nm_manager_get_best_device_for_connection()
       -> nm_device_check_connection_available()
         -> _nm_device_check_connection_available()

The last function checks that a specific device is available to be
activated with the given connection. For virtual devices, it only
checks that the device is compatible with the connection based on the
device type and characteristics, without considering any live network
information.

For OVS interfaces, this doesn't work as expected. During startup, NM
performs a cleanup of the ovsdb to remove entries that were previously
added by NM. When the cleanup is terminated, NMOvsdb sets the "ready"
flag and is ready to start the activation of new OVS interfaces. With
the current mechanism, it is possible that a OVS-interface connection
gets activated via the autoconnect-ports mechanism without checking
the "ready" flag.

Fix that by also checking that the device is available for activation.
2025-02-12 09:53:06 +01:00
Beniamino Galvani
6c1eb99d32 core: cleanup nm_manager_get_best_device_for_connection()
Rename "unavailable_devices" to "exclude_devices", as the
"unavailable" term has a specific, different meaning in NetworkManager
(i.e. the device is in the UNAVAILABLE state). Also, use
nm_g_hash_table_contains() when needed.
2025-02-12 09:51:01 +01:00
Jason A. Donenfeld
c627bbea4c nm-random-utils: always generate good random bytes and prioritize getrandom support
The current mess of code seems like a hodgepodge of complex ideas,
partially copied from systemd, but then subtly different, and it's a
mess. Let's simplify this drastically.

First, assume that getrandom() is always available. If the kernel is too
old, we have an unoptimized slowpath for still supporting ancient
kernels, a path that should be removed at some point. If getrandom()
isn't available and the fallback path doesn't work, the system has much
larger problems, so just crash. This should basically never happen.
getrandom() and having randomness available in general is a critical
system API that should be expected to be available on any functioning
system.

Second, assume that the rng is initialized, so that asking for random
numbers should never block. This is virtually always true on modern
kernels. On ancient kernels, it usually becomes true. But, more
importantly, this is not the responsibility of various daemons, even
ones that run at boot. Instead, this is something for the kernel and/or
init to ensure.

Putting these together, we adopt new behavior:

- First, try getrandom(..., ..., 0). The 0 flags field means that this
  call will only return good random bytes, not insecure ones.

- If this fails for some reason that isn't ENOSYS, crash.

- If this fails due to ENOSYS, poll on /dev/random until 1 byte is
  available, suggesting that subsequent reads from the rng will almost
  have good random bytes. If this fails, crash. Then, read from
  /dev/urandom. If this fails, crash.

We don't bother caching when getrandom() returns ENOSYS. We don't apply
any other fancy optimizations to the slow fallback path. We keep that as
barebones and minimal as we can. It works. It's for ancient kernels. It
should be removed soon. It's not worth spending cycles over. Instead,
the goal is to eventually reduce all of this down to a simple boring
call to getrandom(..., ..., 0).

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2127
2025-02-11 10:04:26 +01:00
Georg Müller
2fd34e1dec libnm-core: fix error message if address-data parsing fails
The code checks for presence of 'address' and 'prefix', so these fields
should be part of the error message.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2118
2025-02-11 10:01:31 +01:00
Lubomir Rintel
36bc62309b merge: branch 'lr/jenkins-custom-fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2130
2025-02-10 11:31:57 +01:00
Lubomir Rintel
5eefd2d59c Revert "cloud-setup: parse OCI metadata related to VLAN config"
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2129

This reverts commit cfd7dd86c9.
2025-02-07 11:03:13 +01:00
Vladimír Beneš
f7db7c78e9 release: bump version to 1.51.7 (development) 2025-02-07 10:18:15 +01:00
Lubomir Rintel
3c8e7bb69d CI: update images 2025-02-06 10:40:09 +01:00
Lubomir Rintel
dd0b4e72e8 fedora/REQUIRED_PACKAGES: make teamd and dhclient optional
They are no longer in RHEL 10 and we can build just fine without them.
2025-02-06 10:40:09 +01:00
Lubomir Rintel
5409d4f5cd fedora/REQUIRED_PACKAGES: speed up optional packages installation
Don't try to install one by one by calling dnf repeatedly.
It is slow. Instead, use --skip-broken option.
2025-02-06 10:40:09 +01:00
Lubomir Rintel
593608c604 fedora/REQUIRED_PACKAGES: make cscope and bash-completion optional
We do not actually need them.
2025-02-06 10:40:09 +01:00
Lubomir Rintel
64f8ec6099 rpm/build*.sh: trap failures 2025-02-06 10:40:09 +01:00
Lubomir Rintel
6f9ecc7621 rpm/build_clean: do not use jq
It is not available when bootstrapping in beaker. Python is always
there.
2025-02-06 10:40:09 +01:00
Lubomir Rintel
dcd523a573 rpm/build_clean: fix an error message 2025-02-06 10:40:09 +01:00
Lubomir Rintel
efa4b459fc client/test-client: fix formatting
Fix-up for the preceding merge.
2025-02-06 10:37:29 +01:00
Lubomir Rintel
448b44f912 merge: branch 'lr/cs-oci-revert'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2128
2025-02-06 10:35:31 +01:00
Lubomir Rintel
1b4f946120 Revert "cloud-setup: lookup device by MAC + type instead of just MAC"
This reverts commit daef3b7b3f.
2025-02-06 10:35:02 +01:00
Lubomir Rintel
d1725cd288 Revert "manager: create virtual devices on AddAndActivate()"
This reverts commit eb635c23a7.
2025-02-06 10:35:02 +01:00
Lubomir Rintel
ed9365b3a5 Revert "cloud-setup: create VLANs for multiple VNICs on OCI"
This reverts commit 6ff4b9e57c.
2025-02-06 10:35:02 +01:00
Lubomir Rintel
ca78471b04 Revert "client/test: add test for VLANs on OCI"
This reverts commit 9b258faab4.
2025-02-06 10:35:02 +01:00
Till Maas
a01038c618 merge: branch 'man-nm-conf-connectivity'
man: fix spelling in NetworkManager.conf connectivity response docs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2121
2025-02-05 18:08:39 +00:00
Dan Williams
22f5f71523 man: fix spelling in NetworkManager.conf connectivity response docs
specifid -> specified

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-02-05 17:50:04 +00:00
Beniamino Galvani
4c9af3155b systemd: accept encoded domain names without terminating zero label
Backport the following fix from systemd:

30675a6ee9

This fixes NMCI test failure for test "dhcpv6_hostname".
2025-02-04 15:31:45 +01:00
Beniamino Galvani
5e3b46411c merge: branch 'systemd' into main
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2115
2025-02-04 15:28:11 +01:00
Beniamino Galvani
82773b53d7 merge: branch 'bg/initrd-dns'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2123
2025-02-04 10:49:09 +01:00
Beniamino Galvani
b4776d6ced initrd-generator: support rd.net.dns-backend and rd.net.dns-resolve-mode
Add support for two new command line arguments:

 - `rd.net.dns-backend` used to control the "dns" option in
   NetworkManager configuration;
 - `rd.net.dns-resolve-mode` used to control the "resolve-mode" in the
   global DNS configuration.

The use case for them is the installation of a new system where the
administrator wants to configure aspects of the DNS resolution
starting from the early boot, for example to enable DNS over TLS and
avoid that any query goes out unencrypted.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2123
2025-02-04 10:44:48 +01:00
Beniamino Galvani
43fe39fa71 libnm-glib-aux: move nm_keyfile_add_group()
Move nm_keyfile_add_group() to libnm-glib-aux so that it can be used
by other components such as nm-initrd-generator. Rename it to
nm_key_file_add_group() to be consistent with the GLib API names
(g_key_file_*()).
2025-02-04 10:44:48 +01:00
Beniamino Galvani
05efd5ab62 l3cfg: add the DNS routing rules explicitly
Add the DNS routing rules explicitly instead of tracking them via the
NMGlobalTracker mechanism. Since we do not plan to ever remove them,
there is no reason to track the rules. Also, the current
implementation is buggy because in some situations the rules are
wrongly removed when they should not.

Fixes: bf3ecd9031 ('l3cfg: fix DNS routes')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2125
2025-02-04 10:35:55 +01:00
Beniamino Galvani
f70791fb1f merge: branch 'dnsconfd_plugin_rebased'
Add dnsconfd DNS plugin

Closes #1676

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2096
2025-01-30 12:33:54 +00:00
Tomas Korbar
b8714e86e4 dns: introduce configuration_serial support to the dnsconfd plugin
"configuration_serial" dbus property ensures that the plugin
can mark update 'not pending' when the update is trully finished.
This mechanism exists because of underlying problem of having
to restart, or perform similarly time consuming operation, to change
certain configuration parameters of resolver. If Dnsconfd would
block the update call until the update is finished, we could not
respond to any other requests until the call is finished.
2025-01-29 14:41:47 +01:00
Tomas Korbar
c6e1925dec dns: Add dnsconfd DNS plugin
dnsconfd can now be used as DNS configuration plugin.

If ipvX.routed-dns is set to -1 and dnsconfd plugin is enabled then
routes are added by default.
2025-01-29 14:41:47 +01:00
Tomas Korbar
c08ecfd5fe dns: Add resolve-mode and certification-authority keys to global-dns
Resolve-mode allows user to specify way how the global-dns domains
and DNS connection information should be merged and used.

Certification-authority allows user to specify certification
authority that should be used to verify certificates of encrypted
DNS servers.
2025-01-29 14:41:47 +01:00
Beniamino Galvani
c9be26cf9a format: run nm-code-format
The new clang-format changed the formatting output, update the code.
2025-01-29 14:38:22 +01:00
Beniamino Galvani
17f274d5b4 libnm-glib-aux: fix build error with GCC 15
Fix the following error with GCC 15:

  ../src/libnm-glib-aux/nm-shared-utils.c:35:42: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization]
     35 | const char _nm_hexchar_table_lower[16] = "0123456789abcdef";
        |                                          ^~~~~~~~~~~~~~~~~~
  ../src/libnm-glib-aux/nm-shared-utils.c:36:42: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization]
     36 | const char _nm_hexchar_table_upper[16] = "0123456789ABCDEF";
        |                                          ^~~~~~~~~~~~~~~~~~

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2116
2025-01-28 17:07:26 +01:00
Lubomir Rintel
49e7db7047 cloud-setup: avoid accidental cast into a smaller type
This resulted in what looked like more significant bits of GType pointer
sometimes falling off the cliff, presumably because of a cast to
NMDeviceType enum (that probably ends up actually being a char).

This was silent enough to not emit compiler warnings and only occurring
with some very rare situations (needs GCC with LTO and some of the
optimization flags used by Fedora 41).

Fixes: cf6af54ffa ('cloud-setup: allow VETH along with ETHERNET too')
Fixes: 6ff4b9e57c ('cloud-setup: create VLANs for multiple VNICs on OCI')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2119
2025-01-28 14:05:55 +01:00
Lubomir Rintel
cc4a0a9f10 test-client: collect pexpect subprocess status
Always explicitly tear down pexpect instances and collect their
results. Assert on the results after orderly teardowns.

Track the current pexpect instance in test context so that it could be
still collected if the test blows up. That could provide more clue into
what went wrong in the test if it's due to a crash the testee.

Before:

  [1573928.02238] <debug> config device C0:00:00:00:00:10: creating vlan connection for VLAN 700 on C0:00:00:00:00:10...
  [1573928.02330] <debug> config device C0:00:00:00:00:10: connection "vlan2" (ac3c08f5-3e5c-38a3-a366-c16253de6db2) created
  ======================================================================
  ERROR: test_oci_vlans (__main__.TestNmCloudSetup.test_oci_vlans)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
  ...
      pexp.expect("some changes were applied for provider oci")
      ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ...
  pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

After:

  [1573928.02238] <debug> config device C0:00:00:00:00:10: creating vlan connection for VLAN 700 on C0:00:00:00:00:10...
  [1573928.02330] <debug> config device C0:00:00:00:00:10: connection "vlan2" (ac3c08f5-3e5c-38a3-a366-c16253de6db2) created
  *** pexpect'd process killed by SIGABRT ***
  ======================================================================
  ERROR: test_oci_vlans (__main__.TestNmCloudSetup.test_oci_vlans)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
  ...
      pexp.expect("some changes were applied for provider oci")
      ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ...
  pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2119
2025-01-28 14:05:51 +01:00
Lubomir Rintel
7023d8b444 test-client: fix TestNmCloudSetup valgrind run
Allow running the following locally (for quick loval nm-c-s valgrind check),
without requiring $NM_TEST_CLIENT_NMCLI_PATH to be set.

  $ NM_TEST_CLIENT_CLOUD_SETUP_PATH=build/src/nm-cloud-setup/nm-cloud-setup \
      NMTST_USE_VALGRIND=1 python src/tests/client/test-client.py TestNmCloudSetup

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2119
2025-01-28 14:05:48 +01:00
Beniamino Galvani
9282f93f70 systemd: update code from upstream (2025-01-22)
This is a direct dump from systemd git.

  $ git clean -fdx && \
    git cat-file -p HEAD | sed '1,/^======$/ d' | bash - && \
    git add .

======

SYSTEMD_DIR=../systemd
COMMIT=e8908d2fc180f5a98dd37bfbc9c5952de5f18899

(
  cd "$SYSTEMD_DIR"
  git checkout "$COMMIT"
  git reset --hard
  git clean -fdx
)

git ls-files -z :/src/libnm-systemd-core/src/ \
                :/src/libnm-systemd-shared/src/ \
                :/src/libnm-std-aux/unaligned-fundamental.h \
                :/src/libnm-std-aux/unaligned.h | \
  xargs -0 rm -f

nm_copy_sd_shared() {
    mkdir -p "./src/libnm-systemd-shared/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-shared/$1"
}

nm_copy_sd_core() {
    mkdir -p "./src/libnm-systemd-core/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-core/$1"
}

nm_copy_sd_stdaux() {
    mkdir -p "./src/libnm-std-aux/"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-std-aux/${1##*/}"
}

nm_copy_sd_core "src/libsystemd-network/dhcp-duid-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-client-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-option.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h"
nm_copy_sd_core "src/libsystemd-network/network-common.c"
nm_copy_sd_core "src/libsystemd-network/network-common.h"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp-duid.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-internal.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-util.h"
nm_copy_sd_core "src/libsystemd/sd-device/sd-device.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-source.h"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.h"
nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h"
nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c"
nm_copy_sd_core "src/systemd/_sd-common.h"
nm_copy_sd_core "src/systemd/sd-device.h"
nm_copy_sd_core "src/systemd/sd-dhcp-duid.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-client.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-option.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-protocol.h"
nm_copy_sd_core "src/systemd/sd-event.h"
nm_copy_sd_core "src/systemd/sd-id128.h"
nm_copy_sd_core "src/systemd/sd-ndisc.h"
nm_copy_sd_shared "src/basic/alloc-util.c"
nm_copy_sd_shared "src/basic/alloc-util.h"
nm_copy_sd_shared "src/basic/arphrd-util.h"
nm_copy_sd_shared "src/basic/bitfield.h"
nm_copy_sd_shared "src/basic/btrfs.c"
nm_copy_sd_shared "src/basic/btrfs.h"
nm_copy_sd_shared "src/basic/cgroup-util.h"
nm_copy_sd_shared "src/basic/chase.h"
nm_copy_sd_shared "src/basic/chattr-util.c"
nm_copy_sd_shared "src/basic/chattr-util.h"
nm_copy_sd_shared "src/basic/constants.h"
nm_copy_sd_shared "src/basic/devnum-util.c"
nm_copy_sd_shared "src/basic/devnum-util.h"
nm_copy_sd_shared "src/basic/dns-def.h"
nm_copy_sd_shared "src/basic/env-file.c"
nm_copy_sd_shared "src/basic/env-file.h"
nm_copy_sd_shared "src/basic/env-util.c"
nm_copy_sd_shared "src/basic/env-util.h"
nm_copy_sd_shared "src/basic/errno-util.h"
nm_copy_sd_shared "src/basic/escape.c"
nm_copy_sd_shared "src/basic/escape.h"
nm_copy_sd_shared "src/basic/ether-addr-util.c"
nm_copy_sd_shared "src/basic/ether-addr-util.h"
nm_copy_sd_shared "src/basic/extract-word.c"
nm_copy_sd_shared "src/basic/extract-word.h"
nm_copy_sd_shared "src/basic/fd-util.c"
nm_copy_sd_shared "src/basic/fd-util.h"
nm_copy_sd_shared "src/basic/fileio.c"
nm_copy_sd_shared "src/basic/fileio.h"
nm_copy_sd_shared "src/basic/format-ifname.c"
nm_copy_sd_shared "src/basic/format-ifname.h"
nm_copy_sd_shared "src/basic/format-util.c"
nm_copy_sd_shared "src/basic/format-util.h"
nm_copy_sd_shared "src/basic/fs-util.c"
nm_copy_sd_shared "src/basic/fs-util.h"
nm_copy_sd_shared "src/basic/glyph-util.c"
nm_copy_sd_shared "src/basic/glyph-util.h"
nm_copy_sd_shared "src/basic/hash-funcs.c"
nm_copy_sd_shared "src/basic/hash-funcs.h"
nm_copy_sd_shared "src/basic/hashmap.c"
nm_copy_sd_shared "src/basic/hashmap.h"
nm_copy_sd_shared "src/basic/hexdecoct.c"
nm_copy_sd_shared "src/basic/hexdecoct.h"
nm_copy_sd_shared "src/basic/hostname-util.c"
nm_copy_sd_shared "src/basic/hostname-util.h"
nm_copy_sd_shared "src/basic/in-addr-util.c"
nm_copy_sd_shared "src/basic/in-addr-util.h"
nm_copy_sd_shared "src/basic/inotify-util.c"
nm_copy_sd_shared "src/basic/inotify-util.h"
nm_copy_sd_shared "src/basic/io-util.c"
nm_copy_sd_shared "src/basic/io-util.h"
nm_copy_sd_shared "src/basic/iovec-util.h"
nm_copy_sd_shared "src/basic/label.c"
nm_copy_sd_shared "src/basic/label.h"
nm_copy_sd_shared "src/basic/list.h"
nm_copy_sd_shared "src/basic/locale-util.c"
nm_copy_sd_shared "src/basic/locale-util.h"
nm_copy_sd_shared "src/basic/lock-util.h"
nm_copy_sd_shared "src/basic/log.h"
nm_copy_sd_shared "src/basic/macro.h"
nm_copy_sd_shared "src/basic/memory-util.c"
nm_copy_sd_shared "src/basic/memory-util.h"
nm_copy_sd_shared "src/basic/mempool.c"
nm_copy_sd_shared "src/basic/mempool.h"
nm_copy_sd_shared "src/basic/missing_fcntl.h"
nm_copy_sd_shared "src/basic/missing_pidfd.h"
nm_copy_sd_shared "src/basic/missing_random.h"
nm_copy_sd_shared "src/basic/missing_socket.h"
nm_copy_sd_shared "src/basic/missing_stat.h"
nm_copy_sd_shared "src/basic/missing_syscall.h"
nm_copy_sd_shared "src/basic/missing_threads.h"
nm_copy_sd_shared "src/basic/missing_type.h"
nm_copy_sd_shared "src/basic/missing_wait.h"
nm_copy_sd_shared "src/basic/namespace-util.h"
nm_copy_sd_shared "src/basic/ordered-set.c"
nm_copy_sd_shared "src/basic/ordered-set.h"
nm_copy_sd_shared "src/basic/origin-id.h"
nm_copy_sd_shared "src/basic/parse-util.c"
nm_copy_sd_shared "src/basic/parse-util.h"
nm_copy_sd_shared "src/basic/path-util.c"
nm_copy_sd_shared "src/basic/path-util.h"
nm_copy_sd_shared "src/basic/pidfd-util.c"
nm_copy_sd_shared "src/basic/pidfd-util.h"
nm_copy_sd_shared "src/basic/pidref.h"
nm_copy_sd_shared "src/basic/prioq.c"
nm_copy_sd_shared "src/basic/prioq.h"
nm_copy_sd_shared "src/basic/process-util.c"
nm_copy_sd_shared "src/basic/process-util.h"
nm_copy_sd_shared "src/basic/random-util.c"
nm_copy_sd_shared "src/basic/random-util.h"
nm_copy_sd_shared "src/basic/ratelimit.c"
nm_copy_sd_shared "src/basic/ratelimit.h"
nm_copy_sd_shared "src/basic/set.h"
nm_copy_sd_shared "src/basic/sha256.c"
nm_copy_sd_shared "src/basic/sha256.h"
nm_copy_sd_shared "src/basic/signal-util.c"
nm_copy_sd_shared "src/basic/signal-util.h"
nm_copy_sd_shared "src/basic/siphash24.h"
nm_copy_sd_shared "src/basic/socket-util.c"
nm_copy_sd_shared "src/basic/socket-util.h"
nm_copy_sd_shared "src/basic/sort-util.h"
nm_copy_sd_shared "src/basic/sparse-endian.h"
nm_copy_sd_shared "src/basic/stat-util.c"
nm_copy_sd_shared "src/basic/stat-util.h"
nm_copy_sd_shared "src/basic/stdio-util.h"
nm_copy_sd_shared "src/basic/string-table.c"
nm_copy_sd_shared "src/basic/string-table.h"
nm_copy_sd_shared "src/basic/string-util.c"
nm_copy_sd_shared "src/basic/string-util.h"
nm_copy_sd_shared "src/basic/strv.c"
nm_copy_sd_shared "src/basic/strv.h"
nm_copy_sd_shared "src/basic/strxcpyx.c"
nm_copy_sd_shared "src/basic/strxcpyx.h"
nm_copy_sd_shared "src/basic/time-util.c"
nm_copy_sd_shared "src/basic/time-util.h"
nm_copy_sd_shared "src/basic/tmpfile-util.c"
nm_copy_sd_shared "src/basic/tmpfile-util.h"
nm_copy_sd_shared "src/basic/umask-util.h"
nm_copy_sd_shared "src/basic/user-util.h"
nm_copy_sd_shared "src/basic/utf8.c"
nm_copy_sd_shared "src/basic/utf8.h"
nm_copy_sd_shared "src/fundamental/iovec-util-fundamental.h"
nm_copy_sd_shared "src/fundamental/logarithm.h"
nm_copy_sd_shared "src/fundamental/macro-fundamental.h"
nm_copy_sd_shared "src/fundamental/memory-util-fundamental.h"
nm_copy_sd_shared "src/fundamental/sha256-fundamental.c"
nm_copy_sd_shared "src/fundamental/sha256-fundamental.h"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.c"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.h"
nm_copy_sd_shared "src/shared/dns-domain.c"
nm_copy_sd_shared "src/shared/dns-domain.h"
nm_copy_sd_shared "src/shared/log-link.h"
nm_copy_sd_shared "src/shared/web-util.c"
nm_copy_sd_shared "src/shared/web-util.h"
nm_copy_sd_stdaux "src/basic/unaligned.h"
nm_copy_sd_stdaux "src/fundamental/unaligned-fundamental.h"
2025-01-22 18:47:11 +01:00
Beniamino Galvani
610e0cb8cd merge: branch 'bg/dhcp-doc'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2111
2025-01-20 19:06:29 +01:00
Beniamino Galvani
95ac6b71cb man: fix typo 2025-01-20 19:03:51 +01:00
Beniamino Galvani
d0330fb909 man: remove sentence about order of DHCP clients
The list describing the order of DHCP clients is confusing because it
doesn't take into account what clients are disabled at build
time. Instead, just show the available clients in the preferred order.
2025-01-20 19:03:49 +01:00
Beniamino Galvani
774484eed6 man: document which DHCP clients are enabled in this build
Describe in the NetworkManager.conf man page what DHCP clients the
user can set in this build, instead of showing a generic list and
letting the user try each one.
2025-01-20 19:02:06 +01:00
Beniamino Galvani
98b124a661 dhcp: drop dhcpcanon support
Drop support for the "dhcpcanon" DHCP client. It's unmantained, as the
last code change was in 2018:

  https://github.com/juga0/dhcpcanon/commits

There is no need to first deprecate it because it was still marked as
"experimental" in NM. Also, it's not packaged by any recent distro, so
we can assume that nobody will miss it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2112
2025-01-20 18:56:41 +01:00
Lubomir Rintel
79219553be cloud-setup: fix build
Fixes: 6ff4b9e57c ('cloud-setup: create VLANs for multiple VNICs on OCI')
2025-01-20 17:53:58 +01:00
Lubomir Rintel
cf6af54ffa cloud-setup: allow VETH along with ETHERNET too
Pairs of veth devides are used for CI testing in place of real
ethernets. Use GLib types instead of NM numbers, since it's possible to
match them in hierarchical manner, with NMDeviceVeth being a subclass of
NMDeviceEthernet.

Fixes: 6ff4b9e57c ('cloud-setup: create VLANs for multiple VNICs on OCI')
2025-01-20 14:24:11 +01:00
Lubomir Rintel
91878d3653 merge: branch 'lr/oci-vlans'
Resolves: https://issues.redhat.com/browse/RHEL-61770

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2083
2025-01-20 14:11:07 +01:00
Lubomir Rintel
9b258faab4 client/test: add test for VLANs on OCI 2025-01-20 14:08:12 +01:00
Lubomir Rintel
6ff4b9e57c cloud-setup: create VLANs for multiple VNICs on OCI
The idea is to create a pair of VLAN and MACVLAN with AddAndActivate if
they are not present, and otherwise follow the ordinary (GetApplied &
Reapply) procedure if the devices are already present.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
55ed4f7f6d cloud-setup: skip connections unless given type mismatches
Wired and Ipv4 always there, rest varies by connection type (Wired,
Vlan, MacVlan).
2025-01-20 14:08:12 +01:00
Lubomir Rintel
daef3b7b3f cloud-setup: lookup device by MAC + type instead of just MAC
This will be useful for updating configuration of Vlans and MacVlans,
some of having same MAC addresses as devices of other type.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
04f0491a58 cloud-setup: make _device_get_hwaddr() work with all kinds of devices
We'll have Vlans and MacVlans soon, and those don't have permanent
addresses.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
04e426a7bf cloud-setup: s/_nmc_get_hwaddrs()/_nmc_get_ethernet_hwaddrs()/
Make it clear that this only works for Ethernet devices.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
c3861bc50a cloud-setup: add a sync wrapper around AddAndActivate
These will be used to create the software devices.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
87b23669fa client/test: add nm-c-s OCI test
Very basic.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
ecafa051df client/test: add ability to log pexpect traffic 2025-01-20 14:08:12 +01:00
Lubomir Rintel
a0c14665a3 client/test: move run_post() into TestNmcli
It attempts to modify attributes clearly belong to TestNmcli such as
_skip_test_for_l10n_diff or call methods that are in unittest.TestCase:

  ======================================================================
  ERROR: test_002 (__main__.TestNmcli.test_002)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File ".../src/tests/client/test-client.py", line 1508, in f
      self.ctx.run_post()
      ~~~~~~~~~~~~~~~~~^^
    File ".../src/tests/client/test-client.py", line 1185, in run_post
      self.fail(
      ^^^^^^^^^
  AttributeError: 'NMTestContext' object has no attribute 'fail'

It has presumably been moved out of TestNmcli at some point, but that
seems to have been in error, as it's also pretty specific to the nmcli
test cases. Not useful for cloud-init tests that also utilize
NMTestContext. Move it back.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
fadfb7bba1 test/nm-service: add support for creating a MACVLAN
...via AddAndActivate. nm-cloud-setup will do that.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
91524b8419 test/nm-service: create Vlan devices matching the parent by hwaddr
This is how OCI VLANS will be looking up their parents. Make sure the
mock is able to deal with this.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
158adac3a6 test/nm-service: create software devices on AddAndActivate()
This will be useful for testing VLAN bringup.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
93983155bf test/nm-service: add MacvlanDevice class
We'll need to test the nm-cloud-setup OCI multiple VNIC support.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
392f76a23b test/nm-service: add Device.HwAddress property
nm-cloud-setup finds devices by hwaddr. Let's expose it for all device
types, so that we're be able to test once we add VLANs and MACVLANs.
2025-01-20 14:08:12 +01:00
Lubomir Rintel
f7c8597835 test/cloud-meta-mock: do not print what we listen on if we got a FD
This message is useless for non-interactive use and clobbers over
otherwise very appealing test output.

The callers knows what we're going to listen on, it passed us the file
descriptor.
2025-01-20 14:08:12 +01:00
Íñigo Huguet
98f8224376 cloud-setup: oci: remove the max 2 phys NICs limit
Right now, on any baremetal only max. 2 physical NICs are available.
This might change in the future, so better to directly accept larger
nicIndex if we receive it. No behaviour change with this, just remove
an artificial limit.
2025-01-20 14:08:12 +01:00
Íñigo Huguet
cfd7dd86c9 cloud-setup: parse OCI metadata related to VLAN config
Baremetal instances in Oracle Cloud require special VLAN config. Parse
the metadata related to it.
2025-01-20 14:08:12 +01:00
Beniamino Galvani
755cc74175 release: bump version to 1.51.6 (development) 2025-01-20 14:02:23 +01:00
Íñigo Huguet
dd5b4fcf24 nmcs: remove nmcs_provider_*_get_type forward declaration
There is no need to avoid including the full header, they are small
headers with some GLib type system stuff and no more. Just include them
where they are needed.
2025-01-20 06:18:45 +01:00
Íñigo Huguet
7fc22ef5de nmcs: oci: use macro to log warnings 2025-01-20 06:18:45 +01:00
Lubomir Rintel
eb635c23a7 manager: create virtual devices on AddAndActivate()
If the connection didn't exist in advance, there's no unrealized device,
and find_device_by_iface() is not going to get us one.

Call system_create_virtual_device() afrer nm_utils_complete_generic()
completes the connection for virtual devices. Make sure we do proper
cleanup if we happen to fail the activation later, so that de device
doesn't end up hanging there.
2025-01-20 06:18:45 +01:00
Lubomir Rintel
57e140d961 manager: split device creation off from validate_activation_request()
Make validate_activation_request() only do the validation -- split the
determination of the device into find_device_for_activation().

The point of this is to be able complete the connection and actually
create a virtual device after the validation.

I believe this is also somewhat easier to follow now that the procedure
does what its name says.
2025-01-20 06:15:54 +01:00
Lubomir Rintel
25871f1971 manager: reword some error messages
They've been a little too cryptic and unnecessarily long before.
2025-01-20 06:13:59 +01:00
Lubomir Rintel
cfe6e730b3 device: don't log connection UUIDs on device creation
It's irrelevant, doesn't look good, and might possibly be not there
because the connection has not been normalized yet.
2025-01-20 06:13:59 +01:00
Lubomir Rintel
be034a1f3f device: simplify the nm_utils_complete_generic() machinery
The point is to get rid of device/connection type specific arguments, to
eventually be able to complete the connection on AddAndActivate before knowing
which factory is going to take care of creating the device.

Aside from that, the whole thing is pretty awful -- with complicated
macros and variadic argument (ugh). Let's get rid of that.
2025-01-20 06:13:59 +01:00
Lubomir Rintel
6635aeed99 device: get_connection_parent() accept incomplete connections
All of these are wrong asserting that a connection has a particular
setting. On AddAndActivate, the connection can be pretty much empty:

  impl_manager_add_and_activate_connection ()
    validate_activation_request ()
      nm_manager_get_best_device_for_connection ()
      iface = nm_manager_get_connection_iface ()
        find_parent_device_for_connection ()
          nm_device_factory_get_connection_parent () <====== *shriek*
        nm_device_factory_get_connection_iface ()
      find_device_by_iface (iface)
    nm_device_complete_connection ()

Remove those assertions.
2025-01-20 06:13:58 +01:00
Lubomir Rintel
b7a8486c53 device: cleanup get_connection_iface() callbacks
Some of them are wrong: they assert a connection has a particular
setting even though this can be called on AddAndActivate against a
connection that is not complete or normalized:

  impl_manager_add_and_activate_connection ()
    validate_activation_request ()
      nm_manager_get_best_device_for_connection ()
      iface = nm_manager_get_connection_iface ()
        find_parent_device_for_connection ()
          nm_device_factory_get_connection_parent ()
        nm_device_factory_get_connection_iface () <====== here
      find_device_by_iface (iface)
    nm_device_complete_connection ()

Fix those by removing the assertions.

Some of them are also fall back to just calling
nm_connection_get_interface_name() which is a pretty useless thing to do
because nm_device_factory_get_connection_iface() only calls the
device-specific routine if nm_device_factory_get_connection_iface()
doesn't return anything, to give the factory a chance to make up a name
(like <parent>.<vlan-id> for Vlan) on its own. Drop those.
2025-01-20 06:13:58 +01:00
Lubomir Rintel
e3d3f1315a device/factory: document that some callbacks get an incomplete connection
It's get_connection_parent() and get_connection_iface().
2025-01-20 06:13:58 +01:00
Íñigo Huguet
f7a30b3241 merge: branch 'ih/ci-check-tree-optional'
ci: make check-tree optional for branches other than main

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2095
2025-01-17 11:21:25 +00:00
Íñigo Huguet
9e47c9bc6a ci: make check-tree optional for branches other than main
Old branches tend to be formatted with a different versions of
clang-format, so when patches are backported, they introduce some
differences in formatting, making the check-tree job to fail.

These changes in formatting are normally small, and we don't pay much
attention to them, causing that the pipelines are always red, increasing
the work required to check if there are important failures or not.

Make check-tree optional for branches other than main. This way,
failures will be shown as a "warning", and if a pipeline only shows a
warning we don't need to inspect it.
2025-01-17 12:16:43 +01:00
Beniamino Galvani
16b932c200 merge: branch 'pr/precedence'
man/NetworkManager-dispatcher: document /{etc,usr} precedence

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2081
2025-01-16 16:12:12 +00:00
Jonathan Lebon
99bb6b7593 man/NetworkManager-dispatcher: document /{etc,usr} precedence
This seems to be left implied but let's document it explicitly.
2025-01-16 16:11:09 +00:00
Jan Vaclav
191aaf0fb2 merge: branch 'jv/fix-qos-mapping'
platform/vlan: fix incorrect type for ingress/egress qos mappings

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2109
2025-01-16 11:09:13 +00:00
Jan Vaclav
4107a6883f platform/test: reenable xgress qos tests
Fixes: 6e30e37ebe ('test: disable vlan_xgress unit test')
2025-01-16 11:08:44 +00:00
Jan Vaclav
84bcc0eab9 platform/vlan: fix incorrect type for ingress/egress qos mappings
The kernel was updated to add stricter validation to netlink messages,
which revealed this bug:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6c21660fe221a15c789dee2bc2fd95516bc5aeaf

Fixes: a5ea141956 ('platform/vlan: add support for ingress/egress-qos-mappings and changing flags')
2025-01-16 11:08:44 +00:00
Jan Vaclav
9ed9037465 ci: use default_distro for coverity job
Previously, the coverity scheduled job seemed to fail
randomly because the image that it expected to use was
not available, due to not depending on the "prep" job.

This commit resolves the problem by making sure
the image is always built when coverity runs.
2025-01-16 11:21:39 +01:00
Beniamino Galvani
7633b5e493 merge: branch 'bg/fix-routed-dns'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2106
2025-01-15 09:05:01 +01:00
Beniamino Galvani
bf3ecd9031 l3cfg: fix DNS routes
The current approach is flawed. During a commit of the L3
configuration we do a RTM_GETROUTE to find the next-hop to the DNS
server on the current interface, in order to create the DNS route to
inject into the l3cd. However, we haven't added routes to kernel yet
and so the result of the RTM_GETROUTE is going to be wrong.

In some cases, for example when IPv4 DAD is enabled, the bug can't be
easily noticed because we perform multiple commits for the interface,
and the regular routes are already set in kernel from the 2nd commit
on.

To fix the problem, do the following: during a commit we first add
addresses and routes to platform. Then, we create a list of DNS routes
to configure, we collect the old DNS routes, and do a comparison. If
they changed, we need to add the DNS routes to platform in a 2nd step.

Note that in the previous approach we tracked the routes in the
committed-l3cd object of the l3cfg, and so they were applied to kernel
automatically. Because of the 2-step requirement, that no longer works
and we must apply the DNS routes manually.

Fixes: 5449b18a94 ('core: support automatically adding DNS routes')
2025-01-14 23:31:59 +01:00
Beniamino Galvani
aefc7732f0 l3cfg: add the DNS routing rule only when needed
Don't try to add the routing rule that points to the table containing
DNS routes at every commit.

Instead, look into the platform cache to see if the rule already
exists and add it only when needed.
2025-01-14 23:31:59 +01:00
Wen Liang
d3da1d56fd merge: branch 'wl/fix_dhcp_send_release'
dhcp-client4: do not send release message when there is no lease

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2084
2025-01-14 16:13:38 +00:00
Wen Liang
55710d3d7c n-dhcp4: send request directly to avoid unnecessary retransmission timeout
Using `n_dhcp4_c_connection_start_request()` will cause staying in
`connection->request`, as a result, it will cause the resending of
DHCPRELEASE and DHCPDECLINE message, thus, use
`n_dhcp4_c_connection_send_request()` directly instead to avoid
unnecessary retransmission timeout, as suggested by
f030927a54 (r1531834009).
2025-01-14 10:58:36 -05:00
Wen Liang
bccf031591 n-dhcp4: do not send the release message in wrong connection state
We should not send the DHCP release message when udp socket is still in
the PACKET state, this state is typically used during the discovery and
offer phases, where the client broadcasts DHCP packets like DHCPDISCOVER
and receives responses like DHCPOFFER. At this point, the client has no
lease because it has not yet completed the DHCP handshake.
2025-01-14 10:58:36 -05:00
Wen Liang
96ff17fd48 dhcp-client4: do not send release message when there is no lease
The daemon crashes when NM tries to send the release message when there
is no lease yet and the UDP socket is still in the PACKET state, which
causes an assertion failure as the result.

Add the condition to guarantee that n-dhcp4 only sends the release
message when there is a lease.

Resolves: https://issues.redhat.com/browse/RHEL-69132

Stack trace of the crash:
0  0x00007f5ac248bacc __pthread_kill_implementation (libc.so.6 + 0x8bacc)
1  0x00007f5ac243e686 __GI_raise (libc.so.6 + 0x3e686)
2  0x00007f5ac2428833 __GI_abort (libc.so.6 + 0x28833)
3  0x00007f5ac242875b __assert_fail_base (libc.so.6 + 0x2875b)
4  0x00007f5ac24373c6 __assert_fail (libc.so.6 + 0x373c6)
5  0x00005607ec7f194a n_dhcp4_c_connection_udp_send (NetworkManager + 0x8594a)
6  0x00005607eca228cc n_dhcp4_c_connection_start_request (NetworkManager + 0x2b68cc)
7  0x00005607eca14b31 nm_dhcp_client_stop (NetworkManager + 0x2a8b31)
8  0x00005607eca8a4ce _dev_ipdhcpx_cleanup (NetworkManager + 0x31e4ce)
9  0x00005607ecac144d _cleanup_ip_pre (NetworkManager + 0x35544d)
10 0x00005607ecac3f04 _cleanup_generic_pre (NetworkManager + 0x357f04)
11 0x00005607ecad5006 nm_device_cleanup (NetworkManager + 0x369006)
12 0x00005607ecac5230 _set_state_full (NetworkManager + 0x359230)
13 0x00005607ecac8c4a nm_device_state_changed (NetworkManager + 0x35cc4a)
14 0x00007f5ac2daa47b g_idle_dispatch (libglib-2.0.so.0 + 0x5147b)
15 0x00007f5ac2dadf4f g_main_dispatch (libglib-2.0.so.0 + 0x54f4f)
16 0x00007f5ac2e03268 g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa268)
17 0x00007f5ac2dad5a3 g_main_loop_run (libglib-2.0.so.0 + 0x545a3)
18 0x00005607ec7c3eed main (NetworkManager + 0x57eed)
19 0x00007f5ac24295d0 __libc_start_call_main (libc.so.6 + 0x295d0)
20 0x00007f5ac2429680 __libc_start_main_impl (libc.so.6 + 0x29680)
21 0x00005607ec7c43f5 _start (NetworkManager + 0x583f5)
2025-01-14 10:58:36 -05:00
Wen Liang
5993ee8a8a nm-dhcp-client: add argument controlling whether to get next or current lease
In the scenario for sending the release message, we need to guarantee
that NM only sends the release message when the client received a lease
from the server. However, there is some distinction between the
`l3cd_curr` and `l3cd_next` when ACD is pending, because `l3cd_curr` is
NULL but `l3cd_next` is not NULL when ACD is pending. Regardless of
whether ACD is pending or completed, these are all considered the client
have received the release from the server. Therefore, adapt the function
`nm_dhcp_client_get_lease()` to control whether to get next or current
lease.
2025-01-14 10:58:36 -05:00
Fernando Fernandez Mancera
6819f05644 contrib/makerepo.sh: adapt to "fedpkg prep" new behavior
Now "fedpkg prep" command is generating a directory with the "-build"
suffix containing the build directory inside. We need to extract it.

Real example:

If the script is used for a branch related to nm-1-46, the "fedpkg prep"
command will generate a NetworkManager-1.46-build/ directory containing
the NetworkManager-1.46/ sources directory. We just need to move the
NetworkManager-1.46/ out.
2025-01-13 13:29:17 +01:00
Beniamino Galvani
9be28970a6 merge: branch 'bg/encrypted-dns'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2090
2025-01-08 14:44:08 +01:00
Beniamino Galvani
2b194b9f24 NEWS: update 2025-01-07 15:41:46 +01:00
Beniamino Galvani
8f569814ae libnm-core: remove old DNS parsing functions
They are no longer used.
2025-01-07 15:41:45 +01:00
Beniamino Galvani
dd09af121b dispatcher: fix serialization of DNS servers
In the "Action()" D-Bus method, the "nameservers" key used to contain
an array of binary addresses. If we change the key to contain
something else, there can be problems when the NM and the
NM-dispatcher versions mismatch (right after an upgrade or a
downgrade).

To avoid such problem, still send the old key in the old format, and
introduce a new key for the new format. The new format carries the
name servers as a string list, and can encode encrypted DNS servers.
2025-01-07 15:41:45 +01:00
Beniamino Galvani
4c7f1857df initrd-generator: add support for the "rd.net.dns" command line option
Introduce a new kernel command line option named "rd.net.dns" that can
be used to specify a global name server. It accepts name server in a
URI-like form, as for example:

  rd.net.dns=dns+tls://[fd01::1]:5353#mydomain.com
2025-01-07 15:41:44 +01:00
Beniamino Galvani
4422b14704 core, libnm: support per-connection DNS URIs
Accept name servers with a URI syntax in the ipv4.dns and ipv6.dns
properties; and accept them everywhere else in the core and libnm.
2025-01-07 15:41:44 +01:00
Beniamino Galvani
8416a58e26 core: accept DNS URIs in global configuration
Accept name servers specified with an URI syntax in the global
configuration. A plugin that doesn't support a specific scheme can
decide to ignore it and use only the servers it understands. At the
moment there is no plugin that supports DNS-over-TLS servers in the
global configuration.
2025-01-07 15:41:43 +01:00
Beniamino Galvani
4dee109b8d libnm-core: add new functions for DNS parsing
Introduce new functions to parse and normalize name servers. Their
name contains "dns_uri" because they also support a URI-like syntax
as: "dns+tls://192.0.2.0:553#example.org".
2025-01-07 15:41:43 +01:00
Beniamino Galvani
28668f8698 core: simplify nm_l3_config_data_add_nameserver_detail()
Remove unused "server_name" argument. It is still possible to pass the
server name, if needed, with the nm_l3_config_data_add_nameserver()
function. After this change, rename the function to
nm_l3_config_data_add_nameserver_addr(), since the function only
accepts an address.
2025-01-07 15:41:43 +01:00
Wen Liang
85484ab2d3 merge: branch 'wl/vpn_routing_rules'
vpn: fix routing rules support in vpn conenctions

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2092
2025-01-07 14:23:42 +00:00
Wen Liang
308e34a501 vpn: fix routing rules support in vpn conenctions
This commit introduces the ability to manage routing rules specifically
for VPN connections. These rules allow finer control over traffic
routing by enabling the specification of policy-based routing for
traffic over the VPN.

- Updated the connection backend to apply rules during VPN activation.
- Ensured proper cleanup of routing rules upon VPN deactivation.

This enhancement improves VPN usability in scenarios requiring advanced
routing configurations, such as split tunneling and traffic
prioritization.

Resolves: https://issues.redhat.com/browse/RHEL-70160
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2092
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1842
2025-01-07 08:57:11 -05:00
eaglegai
9c42177d09 mptcp: fix error handling rp_filter when kernel don't support mptcp
When the kernel don't support mptcp, NetworkManager should disable mptcp
and shouldn't change rp_filter from 1 to 2. However, when checking file
/proc/sys/net/mptcp/enabled, val v's type is defined to guint32, and
nm_platform_sysctl_get_int32 return -1, v becomes a very large number
and can't set mptcp_flags to NM_MPTCP_FLAGS_DISABLED.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1686
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2093

Fixes: c00873e08f ('mptcp: rework "connection.mptcp-flags" for enabling MPTCP')
2025-01-07 11:20:16 +01:00
Íñigo Huguet
83d99669f5 distros_support.py: always put CentOS Stream at least as Tier 3
We only add to Tier 3 distro versions that ship a version of NM equal or
older to the one that we are testing. As CentOS Stream uses "main", no
stable version will be tested on it.

Force to test CentOS Stream as Tier 3.
2024-12-24 14:42:45 +01:00
Íñigo Huguet
74dba128e9 distros_support.py: fix printing "fedora" entry without "versions" 2024-12-24 14:42:09 +01:00
Íñigo Huguet
af623592f8 ci: update distros
Remove EOL'd, add new versions recently released.
2024-12-24 14:04:54 +01:00
Íñigo Huguet
5c62286a77 release, find-backports: formatting and log small fixes 2024-12-23 12:41:34 +01:00
Íñigo Huguet
248addcc22 find-backports: fix Ignore-Fixes detection
The regex for "Fixes" also matches with "Ignore-Fixes", so the commit is
added twice and then removed only once by the "Ignore-Fixes". It still
remains once in the list of commits to backport, making that
"Ignore-Fixes" does not work. Fix it.
2024-12-23 12:32:13 +01:00
Íñigo Huguet
3caf7178b9 release.sh: check the right pipelines
Now we are using scheduled pipelines for various purposes like
regenerating the container images and triage the issues and MRs. That
means that the last pipeline ran for main might not be the pipeline with
the jobs building and testing the code.

Use `source=push` to retrieve only pipelines that are not scheduled.
2024-12-23 12:32:13 +01:00
Íñigo Huguet
88b7cf0f28 release: fix help text
The help text is read from the comments at the top of the script itself.
However, to detect what lines belongs to the help text, a range was
defined as:
- Start: any line starting with `# `
- End: any line starting `# Run with --no-test`

If any later line starts with `# ` is considered as a new matching
range, and from it to the end of the file is printed too.

Fix it by defining the range:
- Start: line 2
- End: blank line
2024-12-23 12:32:13 +01:00
Íñigo Huguet
b5ef0c917e release: bump version to 1.51.5 (development) 2024-12-23 09:44:22 +01:00
Íñigo Huguet
fdf1a9fb1e libnm: use nm_strndup_a instead of strndupa
Alpine doesn't have strndupa.

Fixes: 38d1bcee3b ('ip: configurable address pool and lease time of DHCP server in shared mode')
2024-12-20 20:25:14 +01:00
Íñigo Huguet
a1b44d1958 merge: branch 'ih/release-freedesktop'
release.sh: release to freedesktop.org, not to GNOME

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2091
2024-12-20 15:33:58 +00:00
Íñigo Huguet
f05192ada8 release.sh: release to freedesktop.org, not to GNOME
GNOME has changed the process to publish releases to download.gnome.org.
Now, it is required to do it from the CI of projects hosted in GNOME's
repositories.

As we don't have the project hosted there, we have 2 options:
- Create a mirror and set up the CI so we continue using
  download.gnome.org.
- Stop publishing the tarballs there and do it in gitlab.freedesktop.org
  from now on.

After a brief discussion we have decided that the second makes more
sense, so adapt release.sh to do that.

https://discourse.gnome.org/t/gnome-release-service-ftpadmin-replacement-coming-11th-december/25487
https://handbook.gnome.org/maintainers/making-a-release.html
2024-12-20 15:33:29 +00:00
Íñigo Huguet
45dad85911 CONTRIBUTING: fix typo
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1676
2024-12-20 16:26:00 +01:00
Fernando Fernandez Mancera
460f0b4bc9 merge: branch 'ff/garp_bond_slb'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2057
2024-12-18 15:47:43 +01:00
Fernando Fernandez Mancera
3f2f922dd9 bonding: send ARP announcement on bonding-slb link/carrier down
When a bond in balance-slb is created, the ports are enabled or disabled
based on carrier and link state. If the link/carrier goes down, the port
becomes disabled and we must make sure the MAC tables of the switches
are updated properly so the traffic is redirected.

In order to solve this, we send a GARP or RARP broadcast packet on the
bond. This fix cover 3 different balance-slb scenarios.

Scenario 1: The bond in balance-slb mode has IPv4 address configured and
some ports connected. Here the bond is acting like active-backup as the
packets will always have as source MAC the address of the bond
interface. When a port goes down, NetworkManager will send a GARP
broadcast announcing the address configured on the bond with the MAC
address configured on the port.

Scenario 2: The bond in balance-slb mode is connected to a bridge and has
some ports connected. The bridge has IPv4 configured. When a port goes
down, NetworkManager will send a GARP broadcast announcing the address
configured on the bridge with the MAC address configured on the port.

Scenario 3: The bond in balance-slb mode is connected to a bridge and
has some ports connected. The bridge does not have IP configuration and
therefore everything is L2. When a port goes down, NetworkManager will
query the FDB table and filter the entries by the ones belonging to the
bridge and the bond ifindexes. Then, it will send a RARP broadcast
announcing every learned MAC address from FDB.

Fixes: e9268e3924 ('firewall: add mlag firewall utils for multi chassis link aggregation (MLAG) for bonding-slb')
2024-12-18 14:45:54 +01:00
Fernando Fernandez Mancera
00f47efcb2 linux-platform: add helper function to query FDB table
The function introduced queries the FDB table via netlink socket. It
accepts a list of ifindexes to filter out the FDB content not related to
it. It returns an array of MAC addresses.

To cltarify this function is unusually exposed directly on
nm-linux-platform.h as we don't want this be part of the whole
NMPlatform object or cache. This, is an exception to the rule to
simplify the integration of this functionality on NetworkManager.

In addition, it also doesn't use the async mechanism that is widely used
on netlink communication across nm-linux-platform. Again, the reason is
to simplify its use, as async communication won't provide a benefit to
the use cases we have planned for this, i.e balance-slb RARP announcing.
2024-12-18 14:45:54 +01:00
Fernando Fernandez Mancera
a63eec924c glib-aux: add nm_ether_addr_hash() helper
Add a hash generation helper for NMEtherAddr struct. This can be used
for HashTables containing pointers to NMEtherAddr structs.
2024-12-18 14:45:54 +01:00
Fernando Fernandez Mancera
69f3493670 l3cfg: add helper function to fetch all the IPv4 configured addresses
This function would be useful when performing operations related to the
IPv4 addresses configured on the l3cfg. E.g this function will be used
for getting the IPv4 to announce on a GARP on bonding-slb when one of
the ports failover.
2024-12-18 14:45:54 +01:00
Beniamino Galvani
aa91d64606 merge: branch 'wwan-mm-ipv6-default'
wwan: enable ipv6 by default in ModemManager backend

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1967
2024-12-18 13:28:30 +00:00
Richard Acayan
def6c987c8 wwan: enable ipv6 by default in ModemManager backend
In the original addition of the ModemManager backend for mobile
broadband, IPv6 was set to be disabled/ignored by default. The original
motivation for this is not obvious, but it should be gone after 11
years. Some carriers have IPv6-only networks for which the default
IPv4-only connection attempt is inappropriate. Enable IPv6 by default to
support more WWAN networks without special configuration.

Changing the default does not affect IPv4-only support thanks to
fallbacks implemented in nm_modem_get_connection_ip_type().

Link: https://gitlab.com/postmarketOS/pmaports/-/issues/2752
Fixes: a9032724cb ('modem-manager: new `NMModemBroadband'')
2024-12-18 12:58:50 +00:00
Gris Ge
c60dd5c9e0 merge: branch 'protect_vpn'
vpn: Place gateway route to table defined in ipvx.route-table

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2085
2024-12-17 08:47:49 +00:00
Gris Ge
6d06286f1d vpn: Place gateway route to table defined in ipvx.route-table
Previously, NM create direct route to gateway to main(254) route table
regardless `ipvx.route-table` value.

Fixed by setting `NMPlatformIP4Route.table_any` to `TRUE`.

Resolves: https://issues.redhat.com/browse/RHEL-69901

Signed-off-by: Gris Ge <fge@redhat.com>
2024-12-12 19:39:41 +08:00
Íñigo Huguet
3bcbe6ed01 merge: branch 'ih/rt-leftover'
l3cfg: remove routes added by NM on reapply

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2080
2024-12-11 15:55:40 +00:00
Íñigo Huguet
c06d130c38 l3cfg: get routes to prune from the list of routes configured by NM
We always sync routes in the main table, but routes in tables other
than main are only pruned if were added by NM, by default. Get the list
of routes to prune from other tables using obj_state->os_nm_configured,
as this tracks what routes were effectively added by NM.

The list should be the same that the one obtained from l3cfg_old. It
could be different if we commited the l3cfg with an NMIPRouteTableSyncMode
of NM_IP_ROUTE_TABLE_SYNC_MODE_MAIN, thus not deleting some routes at
commit time. However, since the previous commit, we never do it.

What all this shows is that starting to use different NMIPRouteTableSyncModes
is probably a bad idea: it will be a source of bugs of routes not being
always synced as users expect, and the use case for them is still to be
known.
2024-12-11 15:52:09 +00:00
Íñigo Huguet
e330eb9c4a l3cfg: remove routes added by NM on reapply
By default, on reapply we were only syncing the main routes table. This
causes that routes added by NM to other tables are not removed on
reapply. This was done to preserve routes added externally, but routes
added by NM itself should be removed.

Add a new route table syncing mode "main + NM routes". This mode
maintains the normal behaviour of syncing completely the main table,
and for other tables removes only routes that were added by us, leaving
the rest untouched. Use this mode by default, as this is what a user
would expect on reapply.

Note: this might not work if NM is restarted between the profile being
modified and the reapply, because NM forgets what routes were added by
itself because of the restart. This is a rare corner case, though.

Use the D-Bus property "VersionInfo" to expose a capability flag
indicating that this bug is fixed. It is the first capability that we
expose in this way. However, it is convenient to do it this way as it's
something that clients like nmstate needs to know, so they can decide
whether a conn down is needed or not. It is not enough to decide that by
version number because it might be fixed via a downstream patch in distros
like RHEL.

https://issues.redhat.com/browse/RHEL-67324
https://issues.redhat.com/browse/RHEL-66262

Fixes: e9c17fcc9b ('l3cfg: default to 'main' route table sync mode')
2024-12-11 15:52:09 +00:00
Íñigo Huguet
e1840ad5fb platform: rename NM_IP_ROUTE_TABLE_SYNC_MODE_FULL -> ALL_EXCEPT_LOCAL
The difference between FULL and ALL was not obvious without reading the
documentation. Moreover, a new mode is going to be introduced so the
confusion could grow. Rename to a more explicit name.
2024-12-11 15:52:09 +00:00
Íñigo Huguet
5a65170b49 libnmc: fix bug checking VersionInfo's capabilities
Remove the `+ 31u` that was making that it would search for bit 1 at
array's element 1, instead of element 0. Fixed comparison >len that
shoudl be >=len. Fix a few typos.

Fixes: bc6098d441 ('libnm: add internal nmc_client_has_{version_info_v,version_info_capability,capability}() helper')
2024-12-11 15:52:09 +00:00
Roman Pavelka
38d1bcee3b ip: configurable address pool and lease time of DHCP server in shared mode
Introduce a new options to NMSettingIpConfig. When set, ipv4.shared-dhcp-range
and ipv4.shared-dhcp-lease-time can be passed to dnsmasq to allow configuration
of DHCP server address pool range and lease time.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/941
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2028
2024-12-11 09:20:15 +01:00
Beniamino Galvani
0209a55d24 contrib/copr: update the URL for nm-git-bundle
The old bundle is no longer available, use the latest one.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2086
2024-12-09 17:38:36 +01:00
Yuki Inoguchi
7fc9711c54 device: add IPv6 sysfs existence check in some ipv6 sysctl functions.
when the kernel boot parameter ipv6.disable=1 is set, NetworkManager
attempts to read files under /proc/sys/net/ipv6, resulting in numerous
error messages in the debug logs. For example:

NetworkManager[758]: <debug> [1726699000.9384] platform-linux: error reading /proc/sys/net/ipv6/conf/lo/disable_ipv6: Failed to open file "/proc/sys/net/ipv6/conf/lo/disable_ipv6": No such file or directory
NetworkManager[758]: <debug> [1726699000.9400] platform-linux: error reading /proc/sys/net/ipv6/conf/lo/accept_ra: Failed to open file "/proc/sys/net/ipv6/conf/lo/accept_ra": No such file or directory
NetworkManager[758]: <debug> [1726699000.9401] platform-linux: error reading /proc/sys/net/ipv6/conf/lo/disable_ipv6: Failed to open file "/proc/sys/net/ipv6/conf/lo/disable_ipv6": No such file or directory
NetworkManager[758]: <debug> [1726699000.9401] platform-linux: error reading /proc/sys/net/ipv6/conf/lo/hop_limit: Failed to open file "/proc/sys/net/ipv6/conf/lo/hop_limit": No such file or directory
NetworkManager[758]: <debug> [1726699000.9401] platform-linux: error reading /proc/sys/net/ipv6/conf/lo/use_tempaddr: Failed to open file "/proc/sys/net/ipv6/conf/lo/use_tempaddr": No such file or directory
NetworkManager[758]: <debug> [1726699000.9401] platform-linux: error reading /proc/sys/net/ipv6/conf/lo/temp_valid_lft: Failed to open file "/proc/sys/net/ipv6/conf/lo/temp_valid_lft": No such file or directory
NetworkManager[758]: <debug> [1726699000.9401] platform-linux: error reading /proc/sys/net/ipv6/conf/lo/temp_prefered_lft: Failed to open file "/proc/sys/net/ipv6/conf/lo/temp_prefered_lft": No such file or directory
...

This also results unnecessary system calls by attempting to open non-existent sysfs.

This patch adds checks in some ipv6 sysctl functions to verify the existence of /proc/sys/net/ipv6.
While there are still other paths that attempts to open IPv6 sysfs, this
eliminates many reading errors.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2040
2024-12-09 15:03:45 +01:00
Beniamino Galvani
6c18fda519 ndisc: honor default route parameters from RA route options
RFC 4191 section-3.1 says:

  When processing a Router Advertisement, a type C host first updates a
  ::/0 route based on the Router Lifetime and Default Router Preference
  in the Router Advertisement message header. [...] The Router Preference
  and Lifetime values in a ::/0 Route Information Option override the
  preference and lifetime values in the Router Advertisement header.

Fix the RA parsing so that the parameters from a default route option
are applied to the gateway.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1666
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2072

Fixes: c3a4656a68 ('rdisc: libndp implementation')
2024-12-06 09:03:32 +01:00
Fernando Fernandez Mancera
bfcc63c37a merge: branch 'bg/keyfile-doc'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2078
2024-12-04 10:38:11 +01:00
Beniamino Galvani
69b18ce914 keyfile: emit a warning when the gateway is set in different keys
The gateway can be set both in the "address*" and and in the "gateway"
keys. Raise a warning when it is set multiple times to different
values.
2024-12-03 17:17:53 +01:00
Beniamino Galvani
38dca2f044 keyfile: write the gateway explicitly
The keyfile format allows to specify the gateway in two ways: with a
separate "gateway" key, or by appending the gateway address to one of
the address$N lines:

  [ipv4]
  address1=192.0.2.1/24
  gateway=192.0.2.254

  [ipv4]
  address1=192.0.2.1/24,192.0.2.254

The former syntax is self-documenting and easier to understand for
users, but NetworkManager defaults to the latter when writing
connection files, for historical reasons. Change that and use the
explicit form.

Note that if a users has scripts manually parsing keyfiles, they could
stop working and so this can be considered an API breakage. OTOH,
those scripts are buggy if they don't support both forms, and they can
already break with perfectly valid user-generated keyfiles.

I think it's acceptable to change the default way to persist keyfiles;
the only precaution would be that this patch should not be applied
during a stable release cycle of a distro.
2024-12-03 17:17:53 +01:00
Beniamino Galvani
dfe9398306 libnm-core: improve keyfile documentation
Clarify the special behavior of some keyfile options.
2024-12-03 17:17:53 +01:00
Beniamino Galvani
40b139bc65 keyfile: test that the output is stable
We already check that a connection doesn't not change when it's
written and re-read from disk. Add another check to verify that the
generated keyfile matches a static one, so that we don't introduce
unwanted changes. The reference keyfiles can be generated by running
the test with "NM_TEST_REGENERATE=1".
2024-12-03 17:17:53 +01:00
Fernando Fernandez Mancera
dd9aca4bd9 libnm: fix warnings due to invalid "closure" annotation
The "closure" annotation needs to be set on the callback parameter
instead of on the data for the callback function.

This patch fixes the following warning:

"""
../src/libnm-core-impl/nm-utils.c:3632: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:4778: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:5776: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:5849: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:5976: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6091: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6448: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6521: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6581: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6663: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-client.c:6728: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:974: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1014: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1041: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:974: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1014: Warning: NM: invalid "closure" annotation: only valid on callback parameters
../src/libnm-client-impl/nm-secret-agent-old.c:1041: Warning: NM: invalid "closure" annotation: only valid on callback parameters
"""
2024-11-27 12:57:00 +01:00
Beniamino Galvani
3b75577871 wifi: fix list corruption when scanning with explicit SSID
Calling c_list_link_tail() on a list entry that already belongs to
another list corrupts the other list, in this case 'old_lst_head';
this is explained in the documentation of c_list_link_before():

 * @what is not inspected prior to being linked. Hence, it better not
 * be linked into another list, or the other list will be corrupted.

This can be reproduced by invoking "nmcli device wifi rescan ssid x"
multiple times; in this way, _scan_request_ssids_track() reuses the
previous SSID data, the list gets corrupted and this causes a crash.

Fixes: 7500e90b53 ('wifi: rework scanning of Wi-Fi device')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2076
2024-11-26 16:17:01 +01:00
Wen Liang
e0b6a2ce92 merge: branch 'wl/skip_acd_noarp'
l3cfg: never retry ACD on NOARP interfaces

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2066
2024-11-15 13:47:22 +00:00
Wen Liang
883399606f l3cfg: never retry ACD on NOARP interfaces
After upgrading to RHEL-9.4, customers have reported that `ip monitor`
repeatedly logs the same route additions every 30 seconds. This issue
appears to stem from NetworkManager continually retrying to add the same
routes due to keep retrying Address Conflict Detection (ACD) on NOARP
interfaces.

To prevent unnecessary route additions and reduce log noise, this change
modifies NetworkManager's behavior to stop retrying ACD on interfaces
with the NOARP flag.

This fix addresses route instability and excessive logging for affected
NOARP configurations.

https://issues.redhat.com/browse/RHEL-59125
2024-11-15 13:46:37 +00:00
Beniamino Galvani
eb620e0e7e platform: fix to_string() functions for IPv6 tunnels
We can hit an assertion at trace log level when printing IPv6 tunnel
links, because the buffer for the local and remote addresses is not
big enough. Increase the buffer size.

Fixes: 32f6e1ef2e ('platform: add IP6TNL links support')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2063
2024-11-14 09:57:26 +01:00
Íñigo Huguet
4b65e716c8 release: bump version to 1.51.4 (development) 2024-11-13 15:21:42 +01:00
Íñigo Huguet
03ff197b96 ci: fix test failures on non Fedora distros 2024-11-12 15:38:17 +01:00
Íñigo Huguet
b33882e57f merge: branch 'ih/glci-testlog-artifact'
CI: various improvements

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2048
2024-11-11 15:22:47 +00:00
Íñigo Huguet
9a35007bac ci: allow to manually select the Fedora version for Tier 1
Versions that has branched out from Rawhide but are still not released
still have many changes that breaks the CI.

As we want the CI to be more stable for Tier 1, which runs for every MR,
do not make the switch as soon as Rawhide has branched, but when we choose so.
2024-11-11 13:55:23 +01:00
Íñigo Huguet
9354fabaa8 ci: Update ci-templates to a version that support Alpine versions
ci-templates only supported alpine:latest, but support for any other
version has been introduced. Use it so our Alpine pipelines stop
failing.
2024-11-11 13:55:23 +01:00
Íñigo Huguet
7cef59c503 ci: rename function in run-test.sh for clarity
I always struggle to understand what 'check_run' means, as it suggests
that the run is executed and the results checked. What it acutally does
is to check if the run passed as argument is selected. Rename to
is_run_selected.

Also, remove check_run_clean which was only a check_run + do_clean. Just
call directly to do_clean.
2024-11-11 13:55:23 +01:00
Íñigo Huguet
0d4c8a235a CI: add testlog.txt as build artifacts
That way we will be able to check the logs in the case of failure.
2024-11-11 13:55:23 +01:00
Beniamino Galvani
23ffa5fc6e core: increase timeout for test_nm_utils_kill_child()
The test starts a watchdog process that eventually kills the process
group after a certain time. When running under valgrind concurrently
to other tests the current timeout is not enough; increase it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2067
2024-11-08 17:32:09 +01:00
Beniamino Galvani
2932825952 device: support IPv6 EUI64 link-local address for ipv6 tunnels
Currently, if a IPv6 tunnel device is configured to use an EUI64
link-local address (via per-connection or global configuration), the
IPv6 configuration fails because NM cannot determine an interface
identifier.

Generate the interface identifier use the same mechanism [1] as
kernel, which relies on the fake "permanent" address and treats the
interface as Ethernet.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv6/addrconf.c?h=v6.11#n2364

Fixes-test: @iptunnel_ip6gre_create_device

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2065
2024-11-08 17:30:06 +01:00
Luna D Dragon
40c187dc15 build: allow building with clang+lto
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2053
2024-11-08 10:21:33 +01:00
Tim Sabsch
fd1a5b3c4b i18n: Update German translation
Fixes a translation issue where teaming and bonding were both translated
als "gebündelt". Proof-read at https://l10n.gnome.org/vertimus/695/379/18/

https://gitlab.gnome.org/Teams/Translation/de/-/issues/8
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2064
2024-11-08 10:15:22 +01:00
Beniamino Galvani
6a2fcfc6b5 merge: branch 'fec'
ethtool: support Forward Error Correction(fec)

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1895
2024-11-07 14:58:08 +00:00
Gris Ge
19bed3121f ethtool: support Forward Error Correction(fec)
Introducing support of ethtool FEC mode:

D-BUS API: `fec-mode: uint32_t`.
Keyfile:

```
[ethtool]
fec-mode=<uint32_t>
```

nmcli: `ethtool.fec-mode` allowing values are any combination of:
 * auto
 * off
 * rs
 * baser
 * llrs

Unit test cases included.

Resolves: https://issues.redhat.com/browse/RHEL-24055

Signed-off-by: Gris Ge <fge@redhat.com>
2024-11-07 17:38:04 +08:00
Wen Liang
0bac01b133 merge: branch 'wl/ip_ping_target'
connection: Support ip-ping-target and ip-ping-timeout

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2034
2024-11-06 12:51:46 +00:00
Wen Liang
658aef0fa1 connection: Support connection.ip-ping-addresses
We have encountered multiple incidents where users face connectivity
issues after booting, particularly due to hardware like switches that do
not pass traffic for a few seconds after startup. And services such as
NFS fail to mount because they try to initiate before the network is
fully reachable. Therefore, we are supporting
`connection.ip-ping-addresses` and `connection.ip-ping-timeout` to
allow administrators to configure the network to verify connectivity to
a specific target(such as a service like NFS) instead of relying on
gateway reachability, which may not always be relevant in certain
network configurations.

Resolves: https://issues.redhat.com/browse/RHEL-21160
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2034
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1797
2024-11-05 14:04:26 -05:00
Wen Liang
f967074521 nm-device: add log indicating gateway ping started
Since we are adding the ping check for the connection.ip-ping-addresses,
it makes more sense to improve the logging to differentiate between the
started ping operations for gateway and connection.ip-ping-addresses.
2024-11-05 13:55:18 -05:00
Valentin Blot
4082e7e109 wwan: remove buggy assertion
Removed an assertion that was not satisfied in the legitimate case of
IPv4 + do_auto.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2061
2024-11-05 11:17:34 +01:00
Beniamino Galvani
1e373ae073 merge: branch 'bg/print-config'
Print the path of internal configuration file with `NetworkManager --print-config`

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2026
2024-11-04 16:09:40 +00:00
Beniamino Galvani
2844b205ab core: print the internal configuration file with "--print-config"
When there is a non-empty internal configuration file, print it in the
output of "NetworkManager --print-config".

Before:
  NetworkManager --print-config:
  # NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf, /usr/lib/NetworkManager/conf.d/{00-server.conf,22-eth-mac-addr.conf}
  ...

After:
  NetworkManager --print-config:
  # NetworkManager configuration: /etc/NetworkManager/NetworkManager.conf, /usr/lib/NetworkManager/conf.d/{00-server.conf,22-eth-mac-addr.conf}, /var/lib/NetworkManager/NetworkManager-intern.conf
  ...

Tests needs to be changed because now writing to the internal file
causes a change of the description of the NMConfigData and therefore
the NM_CONFIG_CHANGE_CONFIG_FILES flag is set.
2024-11-04 17:04:52 +01:00
Beniamino Galvani
07113dde30 core: fix deleting internal global DNS configuration
The tracking of variable "has_intern" in intern_config_read() is
wrong: we set it when adding any entry to the keyfile, but then we
remove the global DNS section without updating the variable.

The effect is that the function might return an empty keyfile instead
of NULL.

Fix this by moving the check on global DNS above.

Fixes: 55c204b9a3 ('core: add support for reading global DNS configuration from keyfile')
2024-11-04 17:04:51 +01:00
Beniamino Galvani
40ac7b1406 core: print full configuration paths with "--print-config"
In the output of "NetworkManager --print-config" we currently print
the list of configuration snippets in an abbreviated form:

  ... (lib: 00-server.conf, 22-wifi-mac-addr.conf) (etc: 08-unmanaged.conf)

While it is concise and unambiguous, it can be cryptic for
users. Instead, print the full paths:

  ... /usr/lib/NetworkManager/conf.d/{00-server.conf,22-wifi-mac-addr.conf}, /etc/NetworkManager/conf.d/{08-unmanaged.conf}
2024-11-04 17:04:51 +01:00
Wen Liang
da014fb148 merge: branch 'wl/update_spec'
spec: add iputils as runtime dependency for ping command

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2058
2024-11-04 15:03:10 +00:00
Wen Liang
7ab3362940 spec: add iputils as recommended dependency for ping command
NetworkManager relies on the ping command provided by `/usr/bin/ping`
from the iputils package to proceed the gateway or ip addresses
connectivity check.  This change ensures that iputils is recommended as a
dependency, making the ping command available for use during runtime but
not enforcing its installation as mandatory since NM can still proceed
to activate the connection even if the ping operation failed.
2024-11-04 14:25:54 +00:00
Fernando Fernandez Mancera
984d56e6f6 release: bump version to 1.51.3 (development) 2024-10-31 15:23:59 +01:00
Andika Triwidada
079a754b1e libnmc/client-utils: typo fix, add closing parenthesis
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2059
2024-10-30 11:05:50 +01:00
Lubomir Rintel
f2a01782a3 test/check-systemd-unit: skip if systemd too old
On RHEL 8, the --offline argument is not yet there.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2060
2024-10-30 11:04:36 +01:00
Wen Liang
afab26a8fa merge: branch 'global_dhcp_hostname_flags'
device: Support configuring dhcp-send-hostname globally

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2029
2024-10-28 13:45:11 +00:00
Wen Liang
fb56168524 keyfile: convert dhcp-send-hostname <-> dhcp-send-hostname-v2 during settings read and write
To have a consistent setting name conversion between
`dhcp-send-hostname` and `dhcp-send-hostname-v2` with nmcli and global
config, convert dhcp-send-hostname <-> dhcp-send-hostname-v2 during
keyfile settings read and write.
2024-10-24 17:03:10 -04:00
Íñigo Huguet
380458b0ee ip-config: Fix the nmcli docs for the renamed dhcp-send-hostname
In nmcli we have renamed dhcp-send-hostname and dhcp-send-hostname-v2 to
dhcp-send-hostname-deprecated and dhcp-send-hostname so users don't need
to worry about the details of the weird workarounds that we sometimes
need to do to expand and/or deprecate some properties.

However, the autogenerated documentation didn't include this names. Add
---nmcli--- specific documentation, adding a new property-infos field
called "rename" with the new name used in nmcli. This field can be used
for more properties if we use the same strategy in the future.
2024-10-24 17:03:10 -04:00
Wen Liang
add4dad505 nmcli: convert everywhere dhcp-send-hostname <-> dhcp-send-hostname-v2
Since introducing the setting ipv[46].dhcp-send-hostname-v2 internally
in NM for supporting global default behavior of DHCP send hostname,
confusion arises for setting the dhcp-send-hostname-v2 and old
dhcp-send-hostname in nmcli. To avoid any confusion from user
configuring dhcp-send-hostname-v2 and old dhcp-send-hostname using
nmcli, introduce the mapping from nmcli argument dhcp-send-hostname to
internal dhcp-send-hostname-v2 property and the mapping from nmcli
argument dhcp-send-hostname-deprecated to internal old dhcp-send-hostname
property.

The change in split_required_fields_for_con_show makes that properties
specified with -g or -f are converted to the libnm's "internal" names.

The change in _print_fill makes that the names are converted to the
"external" user facing names.
2024-10-24 17:03:10 -04:00
Wen Liang
51ea910cc2 device: Support configuring dhcp-send-hostname globally
The user does not want to send machine hostname to the DHCP server
globally by default to avoid ddns record getting created in IPAM.
otherwise, IPAM creates ddns records which might interfere with user's
regular host record. Thus, introduce the ternary property
dhcp_send_hostname_v2 to warrant this behavior.

Notice that we set the GSpec of dhcp-send-hostname-v2 to int, because
defining it as enum would make that it cannot be expanded in a backwards
compatible way if we need to add more values: old clients using libnm
would reject it due to the new value being unknown. Follow the same
strategy than _nm_setting_property_define_direct_enum, defining the
NMSettInfoPropertType as enum, but the glib's GSpec as int.

Resolves: https://issues.redhat.com/browse/RHEL-56565
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2029
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1765
2024-10-24 17:03:10 -04:00
Íñigo Huguet
2bbedbcf7d merge: branch 'ih/nmcs-oci'
cloud-setup: Add OCI (Oracle Cloud) provider

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2056
2024-10-24 14:16:23 +00:00
Íñigo Huguet
4024e5c612 cloud-setup: Add OCI (Oracle Cloud) provider
Initial support for OCI. It doesn't support VLAN configuration yet as
the requirements are not clear. It doesn't support secondary IP
addresses because the IMDS server doesn't expose them.

Instead of using plain text format, it gets a single response in JSON
format and parses it. The dependency to jansson is now mandatory for
that.
2024-10-24 16:14:48 +02:00
Beniamino Galvani
e4c3d46572 merge: branch 'bg/dns-routes'
Support automatically adding DNS routes

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

https://issues.redhat.com/browse/RHEL-56555
2024-10-23 13:45:29 +00:00
Beniamino Galvani
967fed4982 NEWS: update 2024-10-23 15:38:37 +02:00
Beniamino Galvani
5449b18a94 core: support automatically adding DNS routes
When the "ipvX.routed-dns" property is set to true, add a route for
each DNS server via the current interface. The feature works in the
following way.

A new routing rule is created ("priority $PRIO not fwmark $MARK lookup
$TABLE") where $PRIO, $MARK and $TABLE are fixed values and are the
same for all interfaces. This rule is evaluated before standard rules
and tries to look up routes in table $TABLE, where NM adds the routes
to DNS servers.

To determine the next-hop to the name server, NM issues a RTM_GETROUTE
netlink request to kernel, specifying to return the route via the
current interface. In order to avoid results from $TABLE, NM also sets
the fwmark as $MARK in the request.
2024-10-23 15:38:36 +02:00
Beniamino Galvani
5122ba48ef l3cfg: add flag 'routed-dns' to NML3ConfigData 2024-10-23 15:38:35 +02:00
Beniamino Galvani
4e37e4c614 device: remove 'const' qualifier from function signature
nm_device_create_l3_config_data_from_connection() returns an unsealed
NML3ConfigData that can still be modified afterwards.
2024-10-23 15:38:34 +02:00
Beniamino Galvani
0e5815ba84 libnm: add new property "ipvX.routed-dns" 2024-10-23 15:38:33 +02:00
Beniamino Galvani
45535cbf9f platform: support specifying the fwmark in ip_route_get()
Add an optional argument to specify the fwmark, which will be used in
the next commits to return results that match a specific rule.
2024-10-23 15:06:59 +02:00
Beniamino Galvani
5c075eb762 device: emit the "l3cd-changed" signal after commit
I think the current semantics of the NMDevice's "l3cd-changed" signal
is not useful, as it reports that the layer-3 configuration changed
before it is committed to platform.

In this way, the only current subscriber (NMPolicy), reacts to the
change too early: it updates the DNS servers in the system when the
interface doesn't have yet addresses and routes ready. Therefore, the
resolver (libc, systemd-resolved, ...) will try to contact the DNS
server using the wrong parameters.

Change the semantics so that the signal is emitted *after* the commit
to platform.
2024-10-23 15:06:59 +02:00
Beniamino Galvani
3eb45c1d40 l3cfg: simplify signals
During a commit of layer-3 configuration, multiple signals are
emitted:

 - if the combined l3cd configuration changes, we first emit a
   L3CD_CHANGED signal, with flag `commited` FALSE;
 - if the previously committed configuration is different from the one
   we want to commit, we emit again the same signal with `commited`
   TRUE;
 - a PRE_COMMIT signal
 - a POST_COMMIT signal

The usefulness of the first and third signals is questionable: there
is no need to signal that the configuration changes if we are not
going to commit it. Also, PRE_COMMIT is redundant as we just emitted
L3CD_CHANGED. Nobody is using those 2 signals.

Simplify this by leaving only PRE_COMMIT and POST_COMMIT, which are
always emitted during a commit and provide information on the l3cd
changes.

This commit doesn't change behavior.
2024-10-23 15:06:58 +02:00
Beniamino Galvani
3e93134c04 checkpatch: silence warning about direct properties for the IP setting
Since NMSettingIPConfig is an abstract type that cannot be
instantiated, the overrides for the direct properties are defined on
the subclasses (NMSettingIP4Config and NMSettingIP6Config).

Silence the warning about using direct properties.
2024-10-23 15:06:58 +02:00
Beniamino Galvani
d6684269fa merge: branch 'bg/dhcpv4-ipv6-only'
Add support for the "IPv6-Only Preferred" DHCPv4 option

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

https://issues.redhat.com/browse/RHEL-58660
2024-10-23 13:04:12 +00:00
Beniamino Galvani
fe1a1b39d4 NEWS: update 2024-10-23 15:01:21 +02:00
Beniamino Galvani
2c373ec9ed dhcp: allow changing MIN_V6ONLY_WAIT via environment variable
When performing integration tests for the IPv6-only DHCP option, we
want to test that the option is honored and that NM restarts DHCP if
the option goes away. However, the minimum wait time according to the
RFC is 5 minutes, which makes the test take long time.

Allow changing the value via the "NM_TEST_IPV6_ONLY_MIN_WAIT"
environment variable.
2024-10-23 15:01:20 +02:00
Beniamino Galvani
03c01eae29 device: configure IPv6-only-preferred mode in the DHCP client
Configure the DHCP client to enable the IPv6-only-preferred mode based
on the content of the profile and on global configuration.
2024-10-23 15:01:20 +02:00
Beniamino Galvani
022b7ac184 dhcp: support the IPv6-Only Preferred option
Add support for handling the IPv6-Only Preferred option. When enabled,
the client adds the option code to the "Parameter Request List" option
of the DHCPDISCOVER and DHCPREQUEST messages. If the server sends the
option back in the DHCPOFFER and DHCPACK, the host stops the DHCP
client for the time interval specified in the option. After the
timeout expires, DHCP is restarted.
2024-10-23 15:01:19 +02:00
Beniamino Galvani
1fa08e7d1b dhcp: add function nm_dhcp_lease_data_parse_u32()
Add a function to parse 32-bit integer values from a DHCP option.
2024-10-23 15:01:19 +02:00
Beniamino Galvani
1db882ca63 dhcp: allow the plugin to be restarted
In the next commit, a mechanism will be added to stop the DHCP plugin
and restart it without destroying the NMDhcpClient object. For this to
work, we must reset some members of the object when stopping or
starting the plugin.
2024-10-23 15:01:18 +02:00
Beniamino Galvani
b6676aa8ef libnm,nmcli: introduce new ipv4.dhcp-ipv6-only-preferred property
Add a new "ipv4.dhcp-ipv6-only-preferred" property to control the
"IPv6-Only Preferred" DHCPv4 option (RFC 8925). The option indicates
that a host supports an IPv6-only mode and is willing to forgo
obtaining an IPv4 address if the network provides IPv6 connectivity.
2024-10-23 15:01:18 +02:00
Beniamino Galvani
d4af66b298 device: store the effective IP method
Store the effective IP method computed by evaluating the profile,
checking kernel support, or querying device's method
get_ip_method_auto().

The value will be used in a next commit to enable or disable features.
2024-10-23 14:56:41 +02:00
Beniamino Galvani
4af6cf592a nmcli: fix handling of connection.down-on-poweroff property
Fix the following error:

  $ nmcli connection modify C connection.down-on-poweroff yes
  **
  nm:ERROR:../src/libnmc-setting/nm-meta-setting-desc.c:1367:_set_fcn_gobject_ternary: assertion failed: (_gobject_property_get_gtype(G_OBJECT(setting), property_info->property_name) == NM_TYPE_TERNARY)
  Bail out! nm:ERROR:../src/libnmc-setting/nm-meta-setting-desc.c:1367:_set_fcn_gobject_ternary: assertion failed: (_gobject_property_get_gtype(G_OBJECT(setting), property_info->property_name) == NM_TYPE_TERNARY)

Fixes: bd38a19832 ('connection: add support to down-on-poweroff')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2055
2024-10-22 10:50:20 +02:00
Gris Ge
3cb9991fc8 merge: branch 'fix_sriov'
sriov: only valid sriov capacity when enabled

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2051
2024-10-22 02:16:20 +00:00
Gris Ge
421ccf8b4c sriov: only valid sriov capacity when enabled
NetworkManager current code will refuse to activate a connection if its
interface has no SRIOV capacity but holding a empty SRIOV settings.

This patch only valid SRIOV capacity when it is enabled(total_vfs > 0).

Resolves: https://issues.redhat.com/browse/RHEL-58397

Signed-off-by: Gris Ge <fge@redhat.com>
2024-10-21 21:14:11 +08:00
Fernando Fernandez Mancera
c691dd7ecf bonding: steer IGMP queries to the active bond balance-slb primary port
Add chains and rules to steer the IGMP reports to the primary member
port. This rules are adapted from the script provided by Eric Garver.

https://gitlab.com/egarver/virtual-networking/-/blob/master/mlag.sh

Fixes: e9268e3924 ('firewall: add mlag firewall utils for multi chassis link aggregation (MLAG) for bonding-slb')
2024-10-18 11:50:04 +02:00
Íñigo Huguet
88b160cbcc merge: branch 'initial-eps-bearer-settings'
-Added additional initial eps bearer settings

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1915
2024-10-17 06:01:41 +00:00
Íñigo Huguet
c0ac672336 NEWS: update with LTE's EPS bearer changes 2024-10-17 07:56:04 +02:00
Josef Ouano
a47d44cffd wwan: added additional initial eps bearer settings
Added the following settings for initial EPS bearer:
- Username
- Password
- Allowed Auth
- APN Type Setting
2024-10-17 07:53:49 +02:00
Íñigo Huguet
00971b599b merge: branch 'feature/configurable-nmcli-history-file'
nmcli: Move history file to `$XDG_CACHE_HOME`

Closes #1615

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2027
2024-10-14 11:38:39 +00:00
Andreas Hartmann
107730a6a4 NEWS: mention relocation of .nmcli-history. 2024-10-14 11:38:04 +00:00
Andreas Hartmann
66e21700ea nmcli: Move .nmcli-history
from its previous location unter the users `$HOME` directory to
`$XDG_CACHE_HOME/nmcli-history`. This makes `nmcli` compliant with the
[XDG Base Directory Specification][1].

[1]: https://specifications.freedesktop.org/basedir-spec/latest/
2024-10-14 11:38:04 +00:00
Íñigo Huguet
a2abc85504 merge: branch 'nmcli-ask-c-u'
make `nmcli --ask c u` behave as intended

Closes #1618

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2042
2024-10-14 11:24:07 +00:00
Amelia Miner
b9d8f6c4da make nmcli --ask c u behave as intended 2024-10-14 11:24:07 +00:00
Íñigo Huguet
92a2f31531 merge: branch 'ih/ipcalc'
contrib/rpm: Add ipcalc dependency to dispatcher-routing-roules

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2052
2024-10-11 13:55:38 +00:00
Íñigo Huguet
5792038572 contrib/rpm: Add ipcalc dependency to dispatcher-routing-roules
The dispatcher script uses it.
2024-10-11 12:14:50 +02:00
Lubomir Rintel
f5a723ae50 test: check validity of systemd service files
This spots errors like what commit a531458456 ('cloud-setup: fix
placement of directives in the systemd unit') fixes.

This is what a failure would look like:

   5/74 check-nm-cloud-setup.service     FAIL     0.05s   exit status 1
  >>> ...  /bin/bash src/tests/check-systemd-service.sh
      build/src/nm-cloud-setup/nm-cloud-setup.service
  ―――――――――――――――――――――― ✀  ―――――――――――――――――――――――
  build/src/nm-cloud-setup/nm-cloud-setup.service:19:
      Unknown key 'StartLimitIntervalSec' in section [Service], ignoring.

https://issues.redhat.com/browse/RHEL-56860
https://issues.redhat.com/browse/RHEL-49694
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/pipelines/1284415
2024-10-10 01:49:33 +02:00
Íñigo Huguet
c7e0668c27 merge: branch 'ff/fix_unit_test'
fedora: install ethtool explicitly

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2049
2024-10-08 07:31:36 +00:00
Fernando Fernandez Mancera
5f54ced2ee fedora: install ethtool explicitly
Some container images do not have ethtool installed by default and it is
needed for a test-core unit test to run.
2024-10-07 14:09:42 +02:00
Lubomir Rintel
f306d6a2ce merge: branch 'lr/editor-load'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2037
2024-10-05 23:08:13 +02:00
Lubomir Rintel
ecf1e8716c libnm/vpn-editor-plugin: add a comment on a design blunder
VPN plugin factory can never fail, it always returns an object, much
like g_object_new(). If the (GUI) editor is unavailable, it might be
okay for some use cases, notably import()/export(). In such case, the
absence of GUI editor is indicated via capability flags.
2024-10-05 23:06:58 +02:00
Lubomir Rintel
a1a9a6509e libnm/vpn-editor-plugin: add a flag to indicate lack of GUI editor 2024-10-05 23:06:58 +02:00
Lubomir Rintel
c09edb8293 libnm/vpn-editor-plugin: formatting fixes
Fix up a slightly unpleasant comment and docstring formatting.
2024-10-05 23:06:58 +02:00
Lubomir Rintel
1f091945da contrib/nm-vpn-plugin-utils: split editor plugin lookup and load
nm-connection-editor (and presumably the Control Center) expects the
nm_vpn_editor_plugin_factory() to fail if the editor plugin (the thing
that goes into the *-gnome subpackage in Fedora) is not installed.

However, factory() never fails, because the plugin is checked for
existence only when get_editor() is called.
2024-10-05 23:06:58 +02:00
Lubomir Rintel
6747b1c0b8 libnm/vpn-service-plugin: flush D-Bus connection before signalling quit
The plugins tend to exit right away after receiving the "quit" signal,
which may come before the ConnectInteractive() response went out.
This may make NM miss the response, and the error details it contains.

Let's make sure we flush the pending traffic out.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2045
2024-10-05 23:03:13 +02:00
Beniamino Galvani
bb6881f88c format: run nm-code-format
Reformat with:

  clang-format version 19.1.0 (Fedora 19.1.0-1.fc41)

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2046
2024-10-04 11:07:35 +02:00
Fernando Fernandez Mancera
09e822edba release: bump version to 1.51.2 (development) 2024-09-28 22:04:20 +02:00
Beniamino Galvani
a8329587c8 device: fix bug when deactivating port connections asynchronously
When the attach_port()/detach_port() methods do not return immediately
(currently, only for OVS ports), the following situation can arise:

 - nm_device_controller_attach_port() starts the attachment by sending
   the command to ovsdb. Note that here we don't set
   `PortInfo->port_is_attached` to TRUE yet; that happens only after
   the asynchronous command returns;

 - the activation of the port gets interrupted because the connection
   is deleted;

 - the port device enters the deactivating state, triggering function
   port_state_changed()

 - the function calls nm_device_controller_release_port() which checks
   whether the port is already attached; since
   `PortInfo->port_is_attached` is not set yet, it assumes the port
   doesn't need to be detached;

 - in the meantime, the ovsdb operation succeeds. As a consequence,
   the kernel link is created even if the connection no longer exists.

Fix this by turning `port_is_attached` into a tri-state variable that
also tracks when the port is attaching. When it is, we need to perform
an explicit detach during deactivation.

Fixes: 9fcbc6b37d ('device: make attach_port() asynchronous')

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

Resolves: https://issues.redhat.com/browse/RHEL-58026
2024-09-26 15:02:59 +02:00
Íñigo Huguet
0567cfe367 triage: fix typo atention -> attention 2024-09-26 11:04:51 +02:00
Íñigo Huguet
bd177f6d45 merge: branch 'ih/ensure-ci-external-contributor'
triage: ensure that CI is run for MRs from community

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2041
2024-09-26 08:40:21 +00:00
Íñigo Huguet
2c03770649 triage: add link to gitlab-triage docs 2024-09-26 08:40:02 +00:00
Íñigo Huguet
ca59877016 triage: ensure that CI is run for MRs from community
Use a blocking thread to remember the maintainers to run the CI. The
idea is that the maintainers have to run it manually and resolve the
thread.

Due to a limitation in gitlab-triage it has to be done in a weird way:
it is possible to check if the author is member of the project and it is
possible to check if he/she is member of the parent group, but it is not
possible to check if it's member of either one in a single rule. Because
of this a simple rule "author is not member" cannot be created.

To workaround this we create 2 rules to detect if the author IS a member
of the project or the group. If he/she is, we add a label to indicate
it. Then, a 3rd rule checks if this label is missing, and if it's
missing, it means that he/she is not a member.

This issue has been reported to gitlab-triage but it doesn't seem to be
in active maintenaince: https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/issues/362
2024-09-26 08:40:02 +00:00
Beniamino Galvani
fda05b0af0 libnm-core: fix validation of ovs-dpdk interface name
An ovs-dpdk interface doesn't have a kernel link and doesn't have the
15-character limit on the name.

Fixes: 3efe070dfc ('libnm: validate "connection.interface-name" at one place only')

Resolves: https://issues.redhat.com/browse/RHEL-60233

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2044
2024-09-26 09:42:34 +02:00
Fernando Fernandez Mancera
d7d775db82 merge: branch 'ff/fix_ipvlan_setting'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2039
2024-09-24 08:52:59 +02:00
Fernando Fernandez Mancera
5e36063893 test-libnm: add comment explaining one assertion 2024-09-23 17:13:23 +02:00
Fernando Fernandez Mancera
1e70f24378 hsr: fix initialization of port1 and port2 DBus Object property
This was causing test_nml_dbus_meta() unit test to fail and also it was
affecting the notification when the object changed.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
2024-09-23 17:02:34 +02:00
Fernando Fernandez Mancera
6a898fc0a2 ipvlan: fix libnm unit test for ipvlan setting and dbus
Fixes: d238ff487b ('ipvlan: add support to IPVLAN interface')
2024-09-23 16:05:22 +02:00
Fernando Fernandez Mancera
3b95b39582 merge: branch 'ff/ipvlan_support'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2032
2024-09-18 13:42:00 +02:00
Fernando Fernandez Mancera
8f5c18665a NEWS: add support of ipvlan 2024-09-18 13:19:47 +02:00
Fernando Fernandez Mancera
d238ff487b ipvlan: add support to IPVLAN interface
This patch add support to IPVLAN interface. IPVLAN is a driver for a
virtual network device that can be used in container environment to
access the host network. IPVLAN exposes a single MAC address to the
external network regardless the number of IPVLAN device created inside
the host network. This means that a user can have multiple IPVLAN
devices in multiple containers and the corresponding switch reads a
single MAC address. IPVLAN driver is useful when the local switch
imposes constraints on the total number of MAC addresses that it can
manage.
2024-09-18 13:19:42 +02:00
Fernando Fernandez Mancera
b3bdebbad3 libnm-core: add 1.52 macros 2024-09-18 12:04:39 +02:00
Fernando Fernandez Mancera
7e42486010 merge: branch 'ff/hsr_fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2038
2024-09-17 17:41:47 +02:00
Fernando Fernandez Mancera
a0696e27b8 hsr: add hsr setting to docs generate script
The setting was missing from the script. The patch is adding it and also
regenerates the docs.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
2024-09-16 17:04:02 +02:00
Fernando Fernandez Mancera
5e4696a693 hsr: use HSR DBus metadata properly
The HSR DBus metadata was defined properly but not exported on the libnm
library properly. This was causing that clients were not showing the HSR
devices.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
2024-09-16 17:04:02 +02:00
Fernando Fernandez Mancera
4ff3bd3eb5 introspection: fix indentation for HSR device introspection
The file was mixing spaces and tabs. It should only use spaces.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
2024-09-16 17:04:02 +02:00
Fernando Fernandez Mancera
cfe5432de8 release: bump version to 1.51.1 (development) 2024-09-16 12:30:37 +02:00
Fernando Fernandez Mancera
180f6e3739 release: fix version parsing from meson
Fixes: 6707ce0754 ('build: use meson for version info')
2024-09-16 12:21:00 +02:00
Beniamino Galvani
65c4f5e0de merge: branch 'dhcp_lease'
Copy DHCP lease from src, fixing nm_l3_config_data_new_clone assertion

Closes #1620

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2035
2024-09-12 08:48:15 +00:00
Martin von Gagern
a25d593922 core: fix dhcp leases in l3cd cloning.
This will copy DHCP lease from src (not self), fixing an assertion in
nm_l3_config_data_new_clone.

Resolves: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1620
Fixes: 55b722820d ('l3cfg: fix nm_l3_config_data_new_clone() to make exact copy')
2024-09-11 15:57:11 +01:00
Íñigo Huguet
70868fb469 merge: branch 'bg/nmcs-unit-burst'
cloud-setup: fix placement of directives in the systemd unit

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2030
2024-09-11 13:49:40 +00:00
Beniamino Galvani
a531458456 cloud-setup: fix placement of directives in the systemd unit
The "StartLimitIntervalSec" and "StartLimitBurst" directives should be
in the [Unit] section instead of the [Service] one.

Fixes: 927cff9f17 ('cloud-setup: allow bigger restart bursts')
2024-09-11 13:49:21 +00:00
Jan Vaclav
2896c5a38b merge: branch 'jv/drop-autotools'
all: drop autotools build system

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2020
2024-09-11 12:18:40 +00:00
Jan Vaclav
7766368278 NEWS: mention removal of autotools 2024-09-11 12:18:15 +00:00
Jan Vaclav
593580feae build: remove make/autotools from required packages 2024-09-11 12:18:15 +00:00
Jan Vaclav
4db1829bc7 all: remove misc mentions of autotools in docs 2024-09-11 12:18:15 +00:00
Jan Vaclav
c6de9b8f1b build: remove autotools files 2024-09-11 12:18:15 +00:00
Jan Vaclav
28ada2f0b6 build/specfile: remove autotools configuration 2024-09-11 12:18:15 +00:00
Jan Vaclav
12b5b8317b build: remove autotools configuration from scripts 2024-09-11 12:18:15 +00:00
Jan Vaclav
82a6a82031 gitlab-ci: use meson for check-tree 2024-09-11 12:18:15 +00:00
Jan Vaclav
1b0bd9b9b6 build/release: stop trying to bump version in autotools 2024-09-11 12:18:15 +00:00
Jan Vaclav
6707ce0754 build: use meson for version info 2024-09-11 12:18:15 +00:00
Íñigo Huguet
8d672a46d5 merge: branch 'bg/ovs-netdev-assertion'
ovs: fix assertion failure in netdev datapath mode

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2024
2024-09-11 05:20:58 +00:00
Beniamino Galvani
b6e69f3467 ovs: fix assertion failure in netdev datapath mode
When using the netdev datapath, we wait for the link to appear in
different steps:

 1. initially, in act_stage3_ip_config() connects to platform's
   "link-changed" signal to detect when the TUN interface appears;

 2. when the interface appears, _netdev_tun_link_cb() schedules
   _set_ip_ifindex_tun() in a idle handler;

 3. _set_ip_ifindex_tun() checks if the link is ready (e.g. if the MAC
   address is correct) and in that case it reschedules stage3, which
   will move forward with the activation;

 4. if the link is not ready in _set_ip_ifindex_tun(), the function
   connects again to platform's "link-changed" signal to react to link
   changes;

 5. after the link changes and it is ready, _netdev_tun_link_cb()
   reschedules stage3, which moves forward with the activation;

With the current implementation it is possible that after step 2, if
act_stage3_ip_config() runs because it was already scheduled, it
registers again to the "link-changed" event; then when
_set_ip_ifindex_tun() is invoked it will hit assertion:

  nm_assert(!priv->wait_link.tun_link_signal_id);

Fix this by preventing that the signal gets registered again after
step 2.

Fixes-test: @ovs_datapath_type_netdev_with_cloned_mac

Fixes: acf485196c ('ovs-interface: wait that the cloned MAC changes instead of setting it')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2024
2024-09-11 05:20:46 +00:00
Íñigo Huguet
67416d52f4 merge: branch 'ih/distros-supported'
ci: update distros-info.yml and add script to extract useful info from it

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2025
2024-09-10 11:44:16 +00:00
Íñigo Huguet
1b614540b8 distros-info: add option to print all active NM branches
Add option --all to distros_support.py to show all the NM versions that
are being actively used by any active distro. This will be useful to
decide what stable branches are we interested into actively backporting
fixes and which ones we're not.
2024-09-10 11:32:32 +00:00
Íñigo Huguet
8be5aae5b9 ci: update config.yml with the latest info about distros
Content autogenerated by .gitlab-ci/distros_support.py from the content
of .gitlab-ci/distros-info.yml.
2024-09-10 11:32:32 +00:00
Íñigo Huguet
6f34b404e8 distros-info: add script to extract useful info from distros-info.yml
Passing a version number of NetworkManager to this new script, it prints
what distros are using that NM version and generates a new content for
.gitlab-ci/config.yml.

Automatically generating the config.yml content is useful because we can
easily update what distros we test in the CI and the Tier that they
belong, depending on what version of NM do they ship and whether they
have reached EOL or not.

Important: when generating a config.yml for an stable branch, not for
main, it must be generated from main. This is because we are not going
to keep distros-info.yml up to date in all branches, only in main.
2024-09-10 11:32:32 +00:00
Íñigo Huguet
79272e5379 distros-info: update some distros and add useful links
Update the info of some distros.

Add links to facilitate consulting the information in the future when we
want to update it again.
2024-09-10 11:32:32 +00:00
Íñigo Huguet
c985fd19d2 merge: branch 'bg/ip-config-search-fix'
core: fix access to uninitialized memory in NMIPConfig

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2031
2024-09-10 11:28:58 +00:00
Beniamino Galvani
f61a56e25f core: fix access to uninitialized memory in NMIPConfig
The string array returned by nm_l3_config_data_get_searches() is not
NULL-terminated; we need to pass the exact length to
nm_utils_buf_utf8safe_escape_strv() instead of letting the function
scan for the NULL terminator.

Fix the following error reported by valgrind:

  Conditional jump or move depends on uninitialised value(s)
     at 0x4B287DB: g_strv_length (gstrfuncs.c:2948)
     by 0x6EBDBE: nm_utils_buf_utf8safe_escape_strv (nm-shared-utils.c:3047)
     by 0x59A3F1: get_property_ip (nm-ip-config.c:198)
     by 0x4A6E150: UnknownInlinedFun (gobject.c:2140)
     by 0x4A6E150: g_object_get_property (gobject.c:3454)
     by 0x56FB1A: nm_dbus_utils_get_property (nm-dbus-utils.c:95)
     by 0x44B343: _obj_get_property (nm-dbus-manager.c:880)
     by 0x44DC4F: _nm_dbus_manager_obj_notify (nm-dbus-manager.c:1201)
     by 0x56EE77: dispatch_properties_changed (nm-dbus-object.c:253)
     by 0x4A5BF1E: g_object_notify_queue_thaw.lto_priv.0 (gobject.c:755)
     by 0x5997BD: _handle_l3cd_changed (nm-ip-config.c:837)
     by 0x59A129: _l3cfg_notify_cb (nm-ip-config.c:147)
     by 0x4A5B649: g_closure_invoke (gclosure.c:834)

Fixes: 522a7d6baf ('nm-ip-config: escape searches when exposing to dbus')
2024-09-10 09:09:51 +02:00
Jan Vaclav
e779c25690 merge: branch 'jv/escape-ra-searches'
nm-ip-config: escape searches when exposing to dbus

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1993
2024-09-09 11:11:02 +00:00
Jan Vaclav
522a7d6baf nm-ip-config: escape searches when exposing to dbus
Previously, when a connection was configured with search domains
that contained non-ASCII characters, GLib would try to parse the
search name as UTF-8, and an assertion would fail (which meant
that if NM was running with fatal assertions, it would crash).

Expose the search domains only as an escaped string to avoid this.
2024-09-02 12:24:28 +00:00
Jan Vaclav
142e72b5b5 glib-aux: add nm_utils_buf_utf8safe_escape_strv()
This function allows us to escape whole strv arrays, only
copying them when necessary, indicated by the "to_free"
output parameter.
2024-09-02 12:24:28 +00:00
Jan Vaclav
c9fefcd095 nmtui: correctly check that connection list is non-empty
Previously, the "edit" or "delete" buttons were clickable even
if there were no available connections, which was not expected
and caused an assertion to fail when clicked. This is because
the connections list could contain connections that were later
filtered out and not displayed in the final list, but the check
did not take this into account.

Make it so that the buttons are clickable only if we *actually*
have any available connections to edit or delete.

Fixes: 3bda3fb60c ('nmtui: initial import of nmtui')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1991
2024-09-02 12:08:00 +00:00
Beniamino Galvani
abbaa9b629 libnm, nmcli: fix "Since" version for ipv4.link-local=fallback
Fixes: c575293f1b ('device: add ipv4.link-local=fallback (IPv4LL set iff no other IPv4 set)')
2024-09-02 11:52:59 +02:00
Beniamino Galvani
113cc71939 NEWS: update for 1.52 2024-09-02 11:36:59 +02:00
Beniamino Galvani
0f975525a0 merge: branch 'll4_until_dhcp'
Add ipv4.link-local=fallback

Closes #1562

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1980
2024-09-02 08:19:40 +00:00
Dominique Martinet
c575293f1b device: add ipv4.link-local=fallback (IPv4LL set iff no other IPv4 set)
When a connection with ipv4.method=auto (DHCP) is configured with
ipv4.link-local=enable we were leaving the link-local address forever,
but this is not correct according to RFC3927[1] which says:
  a host SHOULD NOT have both an operable routable address and an IPv4
  Link-Local address configured on the same interface.

This adds a new mode that is more compliant, which only sets an IPv4
link-local address if no other address is set (through either DHCP lease
or ivp4.addresses setting)

Closes #1562

Link: https://github.com/systemd/systemd/issues/13316
Link: https://datatracker.ietf.org/doc/html/rfc3927#section-1.9 [1]
2024-09-02 08:16:18 +00:00
Dominique Martinet
b3d2902ad4 l3cfg: add new NM_L3_CONFIG_DAT_FLAGS_HAS_IPV4_NON_LL flag
Add a new l3cfg DatFlag to specify that a given l3cd has a
    non-link-local IPv4 set.
    This will be used to enable or disable IPv4LL automatically in fallback
    mode.
2024-09-02 08:16:18 +00:00
Dominique Martinet
beaf4f8db3 l3cfg/ipv4ll: add new nm_platform_ip4_address_is_link_local() helper
Move the static _ip4_address_is_link_local() check to a new global
nm_platform_ip4_address_is_link_local() helper so we can check if
an IPv4 is link local in other files
2024-09-02 08:16:18 +00:00
Dominique Martinet
b39e38f272 device: set dhcpx state back to pending when lease lost
When lease is lost we would keep the DHCP state to READY, but we are
trying to get a new lease at this point so it is closer to PENDING.

Note this does not change how the device is displayed in `nmcli device`,
a connection with an expired lease is still displayed as `connected`.
2024-09-02 08:16:18 +00:00
Beniamino Galvani
a09f9cc616 l3cfg: ensure the probing timeout is initialized on probe start
When handling event TIMEOUT, "acd_data->probing_timeout_msec" needs to
be always initialized before jumping to "handle_start_probing:";
otherwise, an assertion failure is triggered at:

  static void
  _l3_acd_data_timeout_schedule_probing_restart(AcdData *acd_data, gint64 now_msec)
  {
    ...
    nm_assert(acd_data->probing_timeout_msec > 0);

Even if the ACD data is already in state PROBE, that doesn't mean that
the timeout is already initialized because the PROBE state can also be
reached from a INSTANCE_RESET event; and depending on the previous
state "acd_data->probing_timeout_msec" could be uninitialized.

Fixes-test: @iptunnel_restart
Fixes: b8f9d7b5dd ('l3cfg: rework ACD handling in NML3Cfg to support handling conflicts')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2023
2024-09-02 10:04:11 +02:00
Fernando Fernandez Mancera
851c411df0 release: bump version to 1.51.0 (development) 2024-08-30 14:21:27 +02:00
Fernando Fernandez Mancera
556231a5c9 release: bump version to 1.49.90 (1.50-rc1) 2024-08-30 14:14:15 +02:00
Lubomir Rintel
288ac99211 release: bump version to 1.49.6 (development) 2024-08-29 12:10:58 +02:00
Filip Pokryvka
72a410c1ad nmcli: fix bash completion for fields
The code handling options with supposes, that options
are split by `=`, which is not the case. This fixes the following:

```
nmcli -f ipv4.ad\t\t
nmcli -f ipv4.ad=ipv4.addresses

nmcli --field ipv4.ad\t\t
nmcli --field ipv4.ad=ipv4.addresses
```

Using options with values separated with `=` remains broken,
but this change doesn't affect it:

```
nmcli --field=ipv4.ad\t\t
nmcli --field=ipv4.ad
```

Also, `man` and `usage` uses `--color auto|yes|no`,
not `--color=auto|yes|no`. So, this fix should be sufficient.

Bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=2115827
2024-08-28 15:44:01 +02:00
Fernando Fernandez Mancera
d8c924caa2 merge: branch 'ih/sys-iface-state-log'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2018
2024-08-28 15:36:36 +02:00
Íñigo Huguet
7dae55f0f2 core: rename NM_DEVICE_MANAGED_TYPE_MANAGED to _TYPE_FULL
Managed type = managed is a bit unclear, because all managed types are
for devices that are managed, but with different levels. Managed type =
managed could be interpreted as other types are unmanaged. Change it to
managed type = full.
2024-08-28 15:35:56 +02:00
Íñigo Huguet
573c48d034 core: rename sys-iface-state to managed-type internally
The previous name was not very self explanatory. Managed type indicates
a bit better what the meaning is.
2024-08-28 15:35:56 +02:00
Íñigo Huguet
b2930f5361 log: show sys-iface-state as managed-type in log messages
This is a better hint for users about the meaning of this value.
2024-08-28 15:35:56 +02:00
Íñigo Huguet
72014db629 cloud-setup: azure: ensure that primary address is placed first
The primary address is that placed at position 0 of all the IP Addresses
of the interface. Sometimes we put it in a different position in the
ipv4s array because we insert them in the order we receive, but it might
happen that the HTTP responses comes back in wrong order.

In order to solve this, we pass the index of the IPv4 address to the
callback and the address is added in the right position directly.

Co-authored-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2024-08-28 15:29:18 +02:00
Lubomir Rintel
927cff9f17 cloud-setup: allow bigger restart bursts
On daemon startup, we may end up enqueueing many nm-cloud-setup.service
restarts in very a short time. That is perfectly fine, just bump the
thresholds so that systemd doesn't get in the way too quickly.

100 requests in 1 seconds seem like a fair choice -- little bit on the
conservative side, yet still giving the service manager some room to
interfere on a chance things really go awry.

https://issues.redhat.com/browse/RHEL-49694
2024-08-28 11:26:11 +02:00
Íñigo Huguet
01bee5a6ad po: add nmtui/nmt-page-veth.c to POTFILES.in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943

Fixes: 187ff4c73b ('nmtui: add veth page')
Reported-by: Piotr Drąg
2024-08-27 09:59:54 +02:00
Íñigo Huguet
fedc37ac48 autotools: fix another filename that was renamed
Fixes: 090d617017 ('src: drop most master references from the code')
2024-08-22 14:44:06 +02:00
Fernando Fernández Mancera
f151952e29 merge: branch 'pre-down-no-network-fix'
device: don't enforce IP cleanup on deactivating state

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2016
2024-08-22 12:25:49 +00:00
Jonathan Kang
c61c552077 device: don't enforce IP cleanup on deactivating state
Don't enforce IP cleanup when devices are in deactivating state, to
make sure that network connection is still available for pre-down
dispatcher phase.

Fixes ac4e63ddda ('ip: support dhcp-send-release in NMSettingIpConfig')

https://bugzilla.suse.com/show_bug.cgi?id=1228154
2024-08-22 12:25:31 +00:00
Íñigo Huguet
56f3911b49 autotools: fix filename that was renamed
Fixes: 090d617017 ('src: drop most master references from the code')
2024-08-22 12:02:48 +02:00
Íñigo Huguet
63818a213b release: bump version to 1.49.5 (development) 2024-08-21 13:54:01 +02:00
Íñigo Huguet
1de0781146 CI: regenerate template 2024-08-21 10:52:49 +02:00
Íñigo Huguet
d5a7d859a5 debian: install policykit-1 or polkitd depending on the version
Old Debian and Ubuntu versions didn't have a separate polkitd yet. Make
both optional so it's installed the one that is available.
2024-08-21 10:37:42 +02:00
Íñigo Huguet
d899f8a1ca merge: branch 'ih/debian-polkit'
CI: fix some distros that fails to install

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2015
2024-08-21 07:59:07 +00:00
Íñigo Huguet
afefa1acde ci: remove CentOS Stream 8 (EOLd)
It even fails to download the image.
2024-08-21 09:00:05 +02:00
Íñigo Huguet
66636370f9 debian: install polkitd instead of policykit-1
Commit c19b5d76c2 ('contrib: install "policykit-1" package on Debian')
added policykit-1 because it was needed to get a translation file.

In recent Debian versions it has been removed. It was only a
transitional package to install polkitd and pkexec. Install polkitd
directly instead.
2024-08-21 08:56:06 +02:00
Íñigo Huguet
d299e000c6 NEWS: update with some of the latest changes 2024-08-21 08:17:33 +02:00
Íñigo Huguet
50c8e6e6b5 format: run nm-code-format 2024-08-21 08:13:08 +02:00
Íñigo Huguet
57c19db32b merge: branch 'lr/sad-nmcli-edit'
nmcli/edit: fix an assertion failure when tab-completing bad setting name

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2014
2024-08-21 05:41:12 +00:00
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
Íñigo Huguet
2bc5c56119 merge: branch 'jv/edit-memory-leak'
nmcli/edit: fix memory leak in extract_setting_and_property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2013
2024-08-21 05:40:17 +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
Íñigo Huguet
76285d321f merge: branch 'bg/hostname-retry'
policy: retry hostname resolution when it fails

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2006
2024-08-21 05:39:43 +00:00
Beniamino Galvani
04ad4c86d0 policy: retry hostname resolution when it fails
Currently if the system hostname can't be determined, NetworkManager
only retries when something changes: a new address is added, the DHCP
lease changes, etc.

However, it might happen that the current failure in looking up the
hostname is caused by an external factor, like a temporary outage of
the DNS server.

Add a mechanism to retry the resolution with an increasing timeout.

https://issues.redhat.com/browse/RHEL-17972
2024-08-21 05:39:22 +00:00
Íñigo Huguet
2c9aa712f9 merge: branch 'ih/sl-po'
po: Update Slovenian (sl) po file

Closes #1602

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2011
2024-08-21 05:38:30 +00:00
Martin
15be563f7a po: Update Slovenian (sl) po file 2024-08-21 05:36:23 +00:00
Íñigo Huguet
1b74651a60 merge: branch 'ih/resync_backoff'
platform: add small backoff time before resync

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2010
2024-08-21 05:35:25 +00:00
Íñigo Huguet
830dd4ad9c platform: add small backoff time before resync
If the socket's RX buffer is full it's probably because other
process is doing lot of changes very quickly, faster than we
can process them. Let's give the writer a small time to finish:
1. Avoid contending the kernel's RTNL lock, so we don't make
   the whole situation even worse and it can finish earlier.
2. Avoid having to resync again and again due to trying to
   resync while the writer is still doing quick changes, so
   we are unable to catch up yet.

This won't help if this situation takes a long time or is
continuous, but that's unlikely to happen, and if it does,
it's the writer's fault for starving the whole system.

There is no need to progresively increase the backoff time
for the same reason: if this situation takes lot of time,
it's the writer's fault. It's neither a good idea because the whole NM
process will end being sleeping long times, not doing anything at all,
without being able to react when the Netlink messages burst stops.
2024-08-21 07:32:22 +02:00
Íñigo Huguet
926bfab5b5 merge: branch 'bg/bridge-vlan-reapply'
Support reapplying bridge port VLANs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2002
2024-08-21 05:30:37 +00:00
Beniamino Galvani
447e50d74e bridge: reapply port VLANs only when necessary
Don't touch the bridge VLANs if they are already set.
2024-08-21 07:29:41 +02:00
Beniamino Galvani
1c43fe5235 platform: add nmp_utils_bridge_normalized_vlans_equal()
Add a function to compare two arrays of NMPlatformBridgeVlan. It will
be used in the next commit to compare the VLANs from platform to the
ones we want to set.

To compare in a performant way, the vlans need to be normalized (no
duplicated VLANS, ranges into their minimal expression...). Add the
function nmp_utils_bridge_vlan_normalize.

Co-authored-by: Íñigo Huguet <ihuguet@redhat.com>
2024-08-21 07:29:39 +02:00
Beniamino Galvani
7ae4660a77 platform: support reading bridge VLANs
Add a function to read the list of bridge VLANs on an interface.
2024-08-21 07:29:38 +02:00
Beniamino Galvani
c5d1e35f99 device: support reapplying bridge-port VLANs
For now, always reapply the VLANs unconditionally, even if they didn't
change in kernel.

To set again the VLANs on the port we need to clear all the existing
one before. However, this deletes also the VLAN for the default-pvid
on the bridge. Therefore, we need some additional logic to inject the
default-pvid in the list of VLANs.

Co-authored-by: Íñigo Huguet <ihuguet@redhat.com>
2024-08-21 07:29:37 +02:00
Beniamino Galvani
e00c81b153 bridge: change the signature for nm_platform_link_set_bridge_vlans()
Currently, nm_platform_link_set_bridge_vlans() accepts an array of
pointers to vlan objects; to avoid multiple allocations,
setting_vlans_to_platform() creates the array by piggybacking the
actual data after the pointers array.

In the next commits, the array will need to be manipulated and
extended, which is difficult with the current structure. Instead, pass
separately an array of objects and its size.
2024-08-21 07:29:36 +02:00
Beniamino Galvani
7d3bfb101f platform: add define for IFLA_BOND_SLAVE_PRIO
The enum value was added in kernel 5.19; add a define for it so that
the compilation doesn't fail with earlier kernels.

Fixes: 79221f79a2 ('src: drop most slave references from the code')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1596
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2012
2024-08-20 13:29:48 +02:00
Fernando Fernandez Mancera
79c1f8c93a merge: branch 'th/lldp-fix-crash'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2007
2024-08-19 12:55:26 +02:00
Thomas Haller
4365de5226 lldp: fix multiple access to argument in logging macro
Fixes: 630de288d2 ('lldp: add libnm-lldp as fork of systemd's sd_lldp_rx')
2024-08-19 12:51:34 +02:00
Thomas Haller
c2cddd3241 lldp: fix crash dereferencing NULL pointer during debug logging
During nm_lldp_neighbor_parse(), the NMLldpNeighbor is not yet added to
the NMLldpRX instance. Consequently, n->lldp_rx is NULL.

Note how we use lldp_x for logging, because we need it for the context
for which interface the logging statement is.

Thus, those debug logging statements will follow a NULL pointer and lead
to a crash.

Fixes: 630de288d2 ('lldp: add libnm-lldp as fork of systemd's sd_lldp_rx')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1550
2024-08-19 12:51:34 +02:00
Fernando Fernandez Mancera
24b8d6b662 release: bump version to 1.49.4 (development) 2024-08-09 16:35:10 +02:00
Fernando Fernandez Mancera
ccee88ad5a merge: branch 'ff/drop_offensive_code'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1984
2024-08-09 15:48:34 +02:00
Fernando Fernandez Mancera
ad68b28843 config: parse autoconnect-ports value on config
As part of the conscious language effort we must provide an alternative
option to configure autoconnect-ports system-wide on NetworkManager
configuration file.
2024-08-09 15:47:32 +02:00
Fernando Fernandez Mancera
3203eb3df0 dbus-interface: rename activation flag to use conscious language 2024-08-09 15:47:32 +02: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
Thomas Haller
47283b7c76 deamon-helper: ensure helper_complete() never returns NULL on success
The in_buffer is initialized with a NULL buffer. If we never receive and
data, the buffer might still be NULL.

Maybe it actually can never happen, but it's not clear that this is
always the case. To be sure, ensure we don't return a NULL buffer on
success.
2024-08-09 15:24:11 +02:00
Fernando Fernandez Mancera
9f6ecbae69 keyfile: do not write offensive terms into keyfile
As part of the conscious language efforts we are not writing offensive
terms into keyfiles anymore. This won't break users upgrading as we
still read such values if they are present into the keyfile.

For existing profiles, NetworkManager will remove the offensive terms
when editing the keyfile.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2009
2024-08-09 15:14:16 +02:00
Íñigo Huguet
8488162d10 merge: branch 'patch-1'
Python gi examples little fix and refactor

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1997
2024-08-06 10:17:24 +00:00
Isidro Arias
4484397a0c examples: take lines out of loop (refactor)
since they will only be executed once.

Also, an error is raised if a connection is not found
2024-08-06 10:17:13 +00:00
Isidro Arias
f141f4bbe7 examples: fix gnome.org link 2024-08-06 10:17:13 +00:00
Isidro Arias
75350b3e76 examples: fix print parenthesis place in get_ips.py
Fixes: 797d9c4403 ('python: make dbus, gi examples, and debug-helper.py python3 ready')
2024-08-06 10:17:13 +00:00
Íñigo Huguet
63f2401ebe merge: branch 'bg/route-dump'
platform: dump only selected route protocols

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1978
2024-08-06 10:16:13 +00:00
Íñigo Huguet
d219277f1a platform: log routes dump failure as error 2024-08-06 10:15:56 +00:00
Beniamino Galvani
7efab8baeb platform: add a retry mechanism in case route dump fails
In case the platform fails dumping a specific route protocol, retry
multiple times. If all attempts fail, emit a warning and proceed as
there is nothing more to do.
2024-08-06 10:15:56 +00:00
Beniamino Galvani
b2635d3461 platform: assert that we only generate route message of tracked proto 2024-08-06 10:15:56 +00:00
Beniamino Galvani
f6411ed941 platform: dump only selected route protocols
When doing a dump of routes, we want to exclude routes having
protocols we do not care about. Since the netlink socket has
STRICT_CHK enabled, we can request multiple dumps for the protocols we
need.

While doing 6 dumps is less efficient than doing 1, it normally
doesn't matter. However, the new implementation is more efficient when
there are e.g. millions of BGP routes that can be excluded from the
results.
2024-08-06 10:15:56 +00:00
Beniamino Galvani
c0ac920f9c platform: introduce array of tracked protocols
Introduce an array of tracked route protocols that will be used in the
next commit. To have the list of protocols defined in a single place,
define a macro.
2024-08-06 10:15:56 +00:00
Wen Liang
5f64f292e6 policy: unblock the autoconnect for children when parent is available
When parent is available and in the process of activation, we should
unblock the autoconnect and schedule an auto activate for the children.
Notice that when the parent is the ovs-interface, the kernel link is
only created in stage3, if we only unblock the children in the stage1,
then the children device and connection will be blocked again due
to the fact the kernel link for the parent ovs-interface is not
existed yet, thus, we have to separately unblock the children
when the parent ovs-interface is in the activated state.

https://issues.redhat.com/browse/RHEL-46904
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2003
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1735
2024-08-02 10:53:21 -04:00
Íñigo Huguet
331c9ccf92 merge: branch 'main'
libnm-systemd-core: Disable sd_dhcp6_client_set_duid_uuid function

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1966
2024-08-02 06:16:17 +00:00
Khem Raj
118e3117fe libnm-systemd-core: Disable sd_dhcp6_client_set_duid_uuid function
When building on musl systems ( with out systemd ), and using LLD linker
from LLVM project we fail to link with undefined symbols.

This symbol is in sd_id128.c but its disabled, so let disable the functions
which need this function.

| x86_64-yoe-linux-musl-ld.lld: error: undefined symbol: sd_id128_get_machine_app_specific
| >>> referenced by sd-dhcp-duid.c:202 (/usr/src/debug/networkmanager/1.48.0/../NetworkManager-1.48.0/src/libnm-systemd-core/src/libsystemd-network/sd-dhcp-duid.c:202)
| >>>               libnm-systemd-core.a.p/src_libsystemd-network_sd-dhcp-duid.c.o:(sd_dhcp_duid_set_uuid) in archive src/libnm-systemd-core/libnm-systemd-core.a
| x86_64-yoe-linux-musl-clang: error: linker command failed with exit code 1 (use -v to see invocation)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-08-01 13:42:41 +00:00
Íñigo Huguet
9a891f5e3c merge: branch 'sertonix-main-patch-00854'
contrib/alpine: remove dbus-glib-dev from required packages

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1992
2024-08-01 10:51:28 +00:00
Sertonix
3dfc846beb contrib/alpine: remove dbus-glib-dev from required packages
The dependency has been removed in 1cf35cb26b
2024-08-01 12:28:47 +02:00
Íñigo Huguet
cf64f73f27 merge: branch 'ih/nmcli_ambiguous_type'
nmcli: ignore non-base setting names for connection type

Closes #1584

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1998
2024-08-01 10:25:54 +00: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
Lubomir Rintel
2cd40063c2 po/ru: back out unintended changes to the metadata
Seems like and older or broken template has snuck in at some point,
replacing "NetworkManager" with "PACKAGE" and removing copyright notices
of other translations. Bring that back.

Fixes: 3444af517f ('po: update Russian (ru) translation')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1996
2024-07-31 12:10:43 +02:00
jtux270
cc45be8da1 po/ru: update translation
[lkundrak@v3.sk: reformatted, didn't touch actual translation]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1996
2024-07-31 12:04:36 +02:00
Lubomir Rintel
20cc73f50c po/ru: update
Updated the translation file, with no changes to the translations,
using: "ninja -C build NetworkManager-update-po"

This is done so that subsequent translation update results in a sensible
diff.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1996
2024-07-31 12:01:39 +02:00
Lubomir Rintel
07742d819a Revert "Update file ru.po"
This reverts commit 12b15f6b7f.
2024-07-31 12:00:46 +02:00
jtux270
12b15f6b7f Update file ru.po 2024-07-31 11:58:31 +02:00
Lubomir Rintel
8d2ca7636d settings: call removed plugins "obsolete" not "deprecated"
The ifcfg-rh plugin is deprecated, yet still present. Call the removed
plugins something different.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1989
2024-07-31 11:57:36 +02:00
Lubomir Rintel
ab3d9ea949 meson: state that ifcfg-rh is deprecated in config summary
It's been deprecated for some time, but it doesn't hurt to point it out.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1989
2024-07-31 11:57:29 +02:00
Fernando Fernandez Mancera
40d51b9104 ovs: fix triggering stage3 activation without DHCP client initialized
It is possible that we learn the link is ready on stage3_ip_config
rather than in link_changed event due to a stage3_ip_config scheduled by
another component. In such cases, we proceed with IP configuration
without allocating the resources needed like initializing DHCP client.

In order to avoid that, if we learn during stage3_ip_config that the
link is now ready, we need to schedule another stage3_ip_config to
allocate the resources we might need.

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

Fixes: 83bf7a8cdb ('ovs: wait for the link to be ready before activating')
2024-07-31 10:57:03 +02:00
Beniamino Galvani
a367f8770b rpm: add "Obsoletes" for removed ifcfg packages in F41
Add the "Obsoletes" to the removed ifcfg packages, so that they are
properly removed on upgrade. Otherwise, the upgrade to the new NM
fails due to failed dependencies.

Fixes: 777418dfd7 ('rpm: disable ifcfg support in Fedora 41')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2001
2024-07-26 11:32:19 +02:00
Beniamino Galvani
c437625a76 ndisc: preserve router preferences
If we add multiple default routes with the same metric and different
preferences, kernel merges them into a single ECMP route, with overall
preference equal to the preference of the first route
added. Therefore, the preference of individual routes is not
respected.

To avoid that, add routes with different metrics if they have
different preferences, so that they are not merged together.

We could configure only the route(s) with highest preference ignoring
the others, and the effect would be the same. However, it is better to
add all routes so that users can easily see from "ip route" that there
are multiple routers available.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1468
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1983

Fixes: 032b4e4371 ('core: use router preference for IPv6 routes')
2024-07-26 09:12:53 +02:00
Fernando Fernandez Mancera
815505fc43 release: bump version to 1.49.3 (development) 2024-07-25 12:04:09 +02:00
Fernando Fernandez Mancera
19040369c3 NEWS: update changes in 1.50 2024-07-25 11:18:26 +02:00
Fernando Fernandez Mancera
83bf7a8cdb ovs: wait for the link to be ready before activating
When activating an ovs-interface we already wait for the cloned MAC
address to be set, ifindex is present and platform link also present but
in some cases this is not enough.

If an udev rule is in place it might modify the interface when it is in
a later stage of the activation causing some race conditions or
problems. In order to solve that, we must wait until the link is fully
initialized.
2024-07-25 10:34:56 +02:00
Beniamino Galvani
4196f26378 merge: branch 'bg/policy-dispose'
policy: assert that the auto-activate list is empty on dispose

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1986
2024-07-24 13:33:34 +00:00
Beniamino Galvani
27b646cfa1 policy: assert that the auto-activate list is empty on dispose
We are currently asserting that the list of devices waiting for
auto-activation in NMPolicy is not empty. This condition is always
false because:

 - NMDevice holds a reference to NMManager
 - NMManager holds a reference to NMPolicy
 - on dispose, NMDevice asserts that it's not in NMPolicy's
   auto-activate list

Therefore if there is any NMDevice alive, NMPolicy must be alive as
well. Instead, if there is no NMDevice alive the list must be empty.

The assertion could fail only when the NMPolicy instance gets
disposed, which usually doesn't happen because it's still referenced
at shutdown.

Fixes: aede228974 ('core: assert that devices are not registered when disposing NMPolicy')
2024-07-23 10:15:43 +02:00
Lubomir Rintel
7f8f68d28a Revert "wwan: Ensure we get existing objects on reset"
This reverts commit c0ddcf2998.
Causes testing to fail.
2024-07-22 15:21:44 +02:00
Beniamino Galvani
777418dfd7 rpm: disable ifcfg support in Fedora 41
https://fedoraproject.org/wiki/Changes/RemoveIfcfgSupportInNM
https://bugzilla.redhat.com/show_bug.cgi?id=2296272
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1985
2024-07-16 14:35:31 +02:00
Gris Ge
83a2595970 activation: Allow changing controller of exposed active connection
When activating a port with its controller deactivating by new
activation, NM will register `state-change` signal waiting controller to
have new active connections. Once controller got new active connection,
the port will invoke `nm_active_connection_set_controller()` which lead
to assert error on
    g_return_if_fail(!nm_dbus_object_is_exported(NM_DBUS_OBJECT(self)))

because this active connection is already exposed as DBUS object.

To fix the problem, we remove the restriction on controller been
write-only and notify DBUS object changes for controller property.

Signed-off-by: Gris Ge <fge@redhat.com>
2024-07-12 17:38:01 +08:00
Beniamino Galvani
a51159f4e8 dhcp: fix indentation
Fixes: bc5d76ca82 ('core/dhcp: adjust client plugin priority')
2024-07-12 11:33:19 +02:00
Lubomir Rintel
3d82b9b318 merge: branch 'lr/deprecate-dhclient'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1988
2024-07-11 15:46:31 +02:00
Lubomir Rintel
d246d9df88 merge branch 'lr/simpler-rpm'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1990
2024-07-11 12:29:26 +02:00
Lubomir Rintel
350ac5acd9 merge: branch 'lr/rpms'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1955
2024-07-11 12:23:12 +02:00
Lubomir Rintel
037450df45 contrib/rpm: remove conditionals for RHEL 7 and older
There's just too much clutter in the SPEC file. Drop some totally
obsolete stuff.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
1ccc1e0041 contrib/rpm: install firewall zone unconditionally
It's the same on all systems we care about.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
954e8c8d64 contrib/rpm: stop conditionalizing default DHCP client
It's the same on all systems we care about.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
811ef6952d contrib/rpm: remove extra 0%{?rhel} from some conditionals
"0%{?rhel} && 0%{?rhel} >= 8" just says 0%{?rhel} twice, redundantly.
Let's not do that.
2024-07-11 12:13:33 +02:00
Lubomir Rintel
c639387071 contrib/rpm: remove ldconfig scriptlets
The file triggers replaced this aeons ago. RHEL 8 definitely has them:

  [root@el8 ~]# rpm -q --filetriggers glibc-common
  transfiletriggerin scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64
  /sbin/ldconfig
  transfiletriggerpostun scriptlet (using /bin/sh) -- /lib, /lib64, /usr/lib, /usr/lib64
  /sbin/ldconfig
  [root@el8 ~]#
2024-07-11 12:13:33 +02:00
Lubomir Rintel
c72a52ed36 NEWS: document dhclient deprecation
https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:32 +02:00
Lubomir Rintel
a2914f1d0a rpm: disable dhclient on Fedora 41 and RHEL 10
They're off by default, but SPEC file turns them on. Don't do that in
future distros.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:32 +02:00
Lubomir Rintel
05b4610667 man: update dhcp client manual after dhclient deprecation
Reflect the change in priority and deprecation in the manual.
Hopefully make it slightly easier to read along the way.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:32 +02:00
Lubomir Rintel
3955be817d core/dhcp-manager: warn if dhclient plugin is requested
It's deprecated. Warn any time it is being considered for loading,
instead of at load time, so that the user gets a warning when they got
the plugin in configuration, even if it's build time disabled.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:31 +02:00
Lubomir Rintel
bc5d76ca82 core/dhcp: adjust client plugin priority
Prioritize internal, which is what most people should be using. Try
dhclient last, so that it's not attempted when not explicitly
configured or everything else fails.
2024-07-11 11:09:31 +02:00
Lubomir Rintel
001b3e9494 build/meson: deprecate dhclient
Make it off by default. Point out it's deprecated in a config summary.

It's not maintained upstream. There's probably not much justification for
using it any more and we'd like to remove it at some point.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:31 +02:00
Lubomir Rintel
49f872e6b5 build/autoconf: deprecate dhclient
Make it off by default. Point out it's deprecated in a config summary.

It's not maintained upstream. There's probably not much justification for
using it any more and we'd like to remove it at some point.

https://issues.redhat.com/browse/RHEL-24622
2024-07-11 11:09:31 +02:00
Fernando Fernandez Mancera
c8005a4e65 merge: branch 'bg/wifi-ap-channel-width'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1950
2024-07-10 14:55:07 +02:00
Beniamino Galvani
7bb5961779 supplicant: honor the 'wifi.channel-width' property in AP mode 2024-07-10 14:53:32 +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
Beniamino Galvani
c32c731272 libnm-core: add 1.50 macros 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
51a43fb301 contrib/rpm: pull in formatting fixes from Fedora 2024-07-10 14:21:19 +02:00
Lubomir Rintel
3d0ddfd6be contrib/rpm: turn %ifcfg_migrate into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
151decd333 contrib/rpm: turn %ifcfg_warning into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
cfc6cd7a74 contrib/rpm: turn %split_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
2066e1743e contrib/rpm: turn %with_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
e4660336e7 contrib/rpm: turn %config_plugins_default_ifcfg_rh into a bcond 2024-07-10 14:21:19 +02:00
Lubomir Rintel
b87845b584 libnmc/secret-agent-simple: advise if WPS PBC enrollment is active
Print a different message on "nmcli --ask d wifi connect" if WPS
enrollment is in progress.

This is the same as GNOME Shell's secret agent (and perhaps
others) do.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1961
2024-07-10 13:15:04 +02:00
Fernando Fernandez Mancera
4f7c04eaf9 tools: add nm-to-rhcos script to our toolset
Script to create a RHCOS custom image containing a NetworkManager rpm from
a copr repository.

In order to have a custom RHCOS image, we cannot modify the image itself but
we can add a custom layered image that includes all RHCOS functionality and
adds additional functionality to it.

Requirements:
- A quay.io registry where you have push access.
- You must have your pull-secret in the same directory where the script is
being run. You can download your pull-secret from:
https://console.redhat.com/openshift/install/pull-secret

In order to install this on nodes from a cluster that already exists it must
be done using MachineConfig operator. In essence the following YAML file
must be created.

```
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
  labels:
    machineconfiguration.openshift.io/role: <role>
  name: os-layer-custom-nm
spec:
  osImageURL: <registry>
```

Please, notice that the role and registry need to be set to your needs.

Then, it can be applied by:

$ oc create -f <yaml file>

Finally, the machines will be ready once the field UPDATED has the True value
in the output of this command.

$ oc get mcp
2024-07-08 13:50:52 +02:00
Stanislas FAYE
71383394d5 release: bump version to 1.49.2 (development) 2024-07-05 13:33:24 +02:00
Stanislas Faye
c05f8d4758 merge: branch 'sf/update-news-for-1.50'
NEWS: update changes in 1.50

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1982
2024-07-05 07:46:00 +00:00
Stanislas FAYE
8e8277bedc NEWS: update changes in 1.50 2024-07-05 09:07:37 +02:00
Beniamino Galvani
5aa5d87ed6 merge: branch 'bg/hostname-fallback-hosts'
Consider entries in /etc/hosts for hostname resolution

https://issues.redhat.com/browse/RHEL-33435
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1974
2024-07-04 13:41:13 +00:00
Beniamino Galvani
543ebef32b docs: document the hostname management workflow 2024-07-04 15:39:03 +02:00
Beniamino Galvani
410afccb32 core: also use /etc/hosts for hostname resolution
Before introducing the hostname lookup via nm-daemon-helper and
systemd-resolved, we used GLib's GResolver which internally relies on
the libc resolver and generally also returns results from /etc/hosts.

With the new mechanism we only ask to systemd-resolved (with
NO_SYNTHESIZE) or perform the lookup via the "dns" NSS module. In both
ways, /etc/hosts is not evaluated.

Since users relied on having the hostname resolved via /etc/hosts,
restore that behavior. Now, after trying the resolution via
systemd-resolved and the "dns" NSS module, we also try via the "files"
NSS module which reads /etc/hosts.

Fixes: 27eae4043b ('device: add a nm_device_resolve_address()')
2024-07-04 15:39:03 +02:00
Beniamino Galvani
229bebfae9 nm-daemon-helper: add "service" argument
Introduce a new argument to specify a comma-separated list of NSS
services to use for the "resolve-address" command. For now only accept
"dns" and "files"; the latter can be used to do a lookup into
/etc/hosts.

Note that previously the command failed in presence of extra
arguments. Therefore, when downgrading NetworkManager without
restarting the service, the previously-installed version of the daemon
(newer) would spawn the helper with the extra argument, and the
newly-installed version of the helper (older) would fail. This issue
only impacts hostname resolution and can be fixed by just restarting
the daemon.

In the upgrade path everything works as before, with the only
difference that the helper will use by default both "dns" and "files"
services.

Don't strictly check for the absence of extra arguments, so that in
the future we can introduce more arguments without necessarily break
the downgrade path.
2024-07-04 15:39:03 +02:00
Beniamino Galvani
8c80077805 wwan: fix code format
Fixes: c0ddcf2998 ('wwan: Ensure we get existing objects on reset')
2024-07-04 15:38:03 +02:00
Cédric Bellegarde
c0ddcf2998 wwan: Ensure we get existing objects on reset
When ModemManager become available, NetworkManager resets
GDBusObjectManagerClient object.

But there is a race condition if object-added is emitted before
modm_ensure_manager(), we need to check existing objects if we want to be
in sync with ModemManager.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1957
2024-07-03 15:07:51 +02:00
Íñigo Huguet
73602b9d98 merge: branch 'ndisc-allow-multiple-gateways'
ndisc: support multiple gateways for a single network

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1952
2024-06-28 11:17:51 +00:00
Stefan Agner
f766059ea8 ndisc: support multiple gateways for a single network
Also check for gateway equality when deduplicate routing entries. This
allows to support multiple routes to the same network using different
gateways. This is useful for Thread networks where multiple BRs route
to the same Thread network. If one of these BRs go offline, fallback to
a different router will be much quicker if multiple entries are present.

Note that quick fallback to a different router requires IPv6
reachability probe to be active. Typically Linux disables reachability
probes on Linux machines which act as IPv6 gateway (when forwarding is
enabled).
2024-06-28 11:17:37 +00:00
Íñigo Huguet
7be55d6eff merge: branch 'jv/nmtui-veth'
nmtui: add veth page

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943
2024-06-28 11:02:11 +00:00
Jan Vaclav
e74f506b81 nmtui: include veth devices in activation dialog 2024-06-28 11:01:51 +00:00
Jan Vaclav
187ff4c73b nmtui: add veth page
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943
2024-06-28 11:01:51 +00:00
Íñigo Huguet
c2e6959af2 merge: branch 'jv/fix-newt-error-handling'
nmtui: handle write() errors correctly in nmt_newt_edit_string

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1971
2024-06-28 10:58:20 +00:00
Jan Vaclav
13317bd536 nmtui: handle write() errors correctly in nmt_newt_edit_string
It might happen that write() returns -1, but the errno is not EINTR.
In that case, the length would be incremented by 1, and the data pointer
to the data being written would be moved back by 1 byte on every error.

Make it so that the function exits with an error if it indicates an error.

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

Fixes: 3bda3fb60c ('nmtui: initial import of nmtui')
2024-06-28 10:58:11 +00:00
Íñigo Huguet
4b66f9fe71 merge: branch 'ih/distros-info-yml'
ci: add file with info about distros that we test

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1977
2024-06-28 10:56:48 +00:00
Íñigo Huguet
e15a9aa1a5 ci: add file with info about distros that we test
Useful to have easily accessible the info of all the distros that we
test, including the version of NM that they ship and their EOL dates so
we can know when to stop testing them.

For now this is only informative, but we can use this info, for example,
to generate the `.gitlab-ci/config.yml` file automatically for each
stable branch.
2024-06-28 10:56:28 +00:00
Beniamino Galvani
c759525e99 merge: branch 'bg/dhcp-remove-addr-on-expiry'
dhcp: remove the address synchronously on lease expiry

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1532
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1939
2024-06-28 07:44:23 +00:00
Beniamino Galvani
514a3cb610 dhcp: remove the address synchronously on lease expiry
When the lease expires, the DHCP client emits a LEASE_UPDATE event
with a NULL l3cd. After returning from the handler, it sends
immediately a DHCP DISCOVER message to try to get a new lease.

It is important that when the DISCOVER gets sent the address is no
longer configured on the interface. Otherwise, the server could see
that it is already in use and assign a different one. Therefore,
remove the address synchronously when handling the event.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1532
2024-06-28 09:42:11 +02:00
Jan Vaclav
593b4e01a4 gitlab-ci: ensure coverity job runs weekly
Currently, the condition is not strict enough, and so the job runs every time a scheduled task is triggered - which is currently daily.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1979
2024-06-28 07:35:32 +00:00
Jan Vaclav
c9327b2e8b agent: print error message character in hex form if it's unprintable
Currently, when the agent manager is sent a registration request
containing UTF-8 characters, it will form an invalid error message
using only one of the bytes from the UTF-8 sequence, which causes
an assertion in glib to fail, which replaces the returned error message
with "[Invalid UTF-8]". It will also print an assertion failure to the
console, or crash NetworkManager on non-release builds.

This commit makes it so that it instead prints out the character in
hexadecimal form if it isn't normally printable, so that it is once
again a valid UTF-8 string.

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

Fixes: a30cf19858 ('agent: add agent manager and minimal agent class')
2024-06-27 11:24:57 +00: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
508d43efc9 gitlab-ci: add coverity submissions to weekly scheduled CI
We currently submit builds to Coverity manually every now and then,
but it would make sense to submit them more frequently and periodically,
so that it can detect defects sooner.

Add a "coverity" stage to the pipeline, which submits a build to Coverit
(the scheduls currently set to run every week).

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1973
2024-06-26 12:58:03 +02:00
Beniamino Galvani
14eaf4e419 merge: branch 'bg/netlink-strict-check'
Enable strict check on the netlink socket

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1962
2024-06-26 07:54:02 +00:00
Beniamino Galvani
185932a1a2 platform: enable strict check on netlink socket dumps
In the future we might want to specify filters when requesting netlink
dumps; this requires that strict check is enabled on the socket.

When enabling strict check, we need to pass a full struct in the
netlink message, otherwise kernel ignores it.

This commit doesn't change behavior.
2024-06-26 09:52:50 +02:00
Beniamino Galvani
2b8d8fe92a platform: don't set RTM_F_LOOKUP_TABLE for IPv6
RTM_F_LOOKUP_TABLE is only needed for IPv4. IPv6 dumps with the flag
are rejected in strict mode.
2024-06-26 09:52:50 +02:00
Beniamino Galvani
cac8c445e0 merge: branch 'feature/mstrodl/connectivity-timeout'
Add a timeout option to connectivity checks

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1968
2024-06-25 08:12:44 +00:00
Mary Strodl
ed318e8774 connectivity: Add a timeout option to connectivity checks
Adds an option in the connectivity section to change the timeout before
the interface is deemed "limited". Previously, it was hardcoded to
20 seconds, but for our usecase (failing over to cell modem if
hardwired ethernet drops), it's nice to be able to failover to another
interface more quickly.
2024-06-24 09:21:34 +00:00
Beniamino Galvani
0d657af256 crypto: regenerate PKCS#12 certificates
The PKCS#12 certificates are using SHA1 and RC2-40, which are deprecated;
regenerate them with:

 $ openssl pkcs12 -export -in test_key_and_cert.pem -inkey test_key_and_cert.pem -certfile test_ca_cert.pem -name "test-pkcs12" -out test-cert.p12
 (key: test)

 $ openssl pkcs12 -export -in test2_key_and_cert.pem -inkey test2_key_and_cert.pem -certfile test2_ca_cert.pem -name "test2-pkcs12" -out test2-cert.p12
 (key: 12345testing)

Before:
 $ openssl pkcs12 -info -in test-cert.p12
 MAC: sha1, Iteration 2048
 MAC length: 20, salt length: 8
 PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048

After:
 $ openssl pkcs12 -info -in test-cert.p12
 MAC: sha256, Iteration 2048
 MAC length: 32, salt length: 8
 PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC, Iteration 2048, PRF hmacWithSHA256
2024-06-24 09:48:42 +02:00
Beniamino Galvani
d2536a7d7f valgrind: update suppression for memmove and inet_pton6
inet_pton6() can be called from different functions, make the
suppression more generic.
2024-06-21 23:03:11 +02:00
Beniamino Galvani
97324356cd release: bump version to 1.49.1 (development) 2024-06-21 15:24:07 +02:00
Gris Ge
606283afdc merge: branch 'bg/ovs-interface-by-mac'
ovs: allow specifying a system OVS interface by MAC address

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1975
2024-06-21 07:50:15 +00:00
Beniamino Galvani
be28a11735 ovs: allow specifying a system OVS interface by MAC address
The OVS interface can be matched via MAC address; in that case, the
"connection.interface-name" property of the connection is empty.

When populating the ovsdb, we need to pass the actual interface name
from the device, not the one from the connection.

Fixes: 830a5a14cb ('device: add support for OpenVSwitch devices')

https://issues.redhat.com/browse/RHEL-34617
2024-06-20 17:02:01 +02:00
Jan Vaclav
a5333f14b5 nm-in-container: create conf.d file instead of modifying journald.conf
Currently, the Dockerfile expects /etc/systemd/journald.conf to exist on the base container,
but sometimes this may not be the case, for example on Fedora 40, which causes
the build process to fail if the host machine is also running Fedora 40.

Update the dockerfile to create a conf.d file instead, which has higher precedence.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1972
2024-06-19 11:47:51 +00:00
Íñigo Huguet
8924bfe18c merge: branch 'jv/add-missing-vaargs'
gen-metadata-nm-settings-nmcli: add missing va_end in _prop_log() after using vaargs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1970
2024-06-19 11:10:58 +00: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
Íñigo Huguet
51531a055f merge: branch 'out-or-range-typo'
libnm: fix typo

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1969
2024-06-19 11:07:25 +00:00
Anders Jonsson
bdb2a488c3 libnm: fix typo 2024-06-19 11:06:59 +00:00
Íñigo Huguet
270285e82a merge: branch 'lr/dac-override-comment'
service: remove a misleading comment

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1963
2024-06-19 11:06:21 +00:00
Lubomir Rintel
fe65ca77d7 service: remove a misleading comment
The comment makes it sounds as if we could do without CAP_DAC_OVERRIDE
if we don't use OpenVSwitch, which is not true. At the very least it's
needed by the VPN plugins we spawn to access cert/key material from
users' homes.
2024-06-19 11:05:49 +00:00
Íñigo Huguet
3ade788716 merge: branch 'th/fedora-22-wifi-mac-addr-conf'
[th/fedora-22-wifi-mac-addr-conf] contrib/rpm: rename section in "22-wifi-mac-addr.conf"

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1936
2024-06-19 11:03:28 +00:00
Thomas Haller
439ddc5101 contrib/rpm: rename section in "22-wifi-mac-addr.conf"
For [connection*] and [device*] sections, any suffix is allowed in
the group.

However (at least for configuration snippets we ship upstream), we
want to give a suffix that matches the name of the configuration
snippet.

It seems more common to use [connection-*] instead of [connection.].
See also "examples/nm-conf.d/*.conf" and "15-carrier-timeout.conf" file
which contains a [device-15-carrier-timeout] section.

Note that this file (in Fedora) is not configuration (installed in
/usr/lib). It is thus not problematic to modify.

Fixes: ea8dbd7a6d ('contrib/rpm: add "22-wifi-mac-addr.conf" to F40+')
2024-06-19 11:02:55 +00:00
Íñigo Huguet
5b215e97b9 merge: branch 'bg/leak'
libnm-core: fix memory leak in nm_setting_to_string()

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1934
2024-06-19 11:02:20 +00:00
Beniamino Galvani
ee5f4402bf libnm-core: fix memory leak in nm_setting_to_string()
Fixes: f957ea2b34 ('core/setting: rework nm_connection_dump()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1934
2024-06-19 11:01:46 +00:00
Íñigo Huguet
5f82c777a8 merge: branch 'bg/wifi-p2p-pending-action'
Fix pending action for WiFi P2P

Closes #1004

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1925
2024-06-19 11:01:24 +00:00
Beniamino Galvani
82032955dd wifi-p2p: consider if the device is enabled when adding pending action
If the device gets rfkill-blocked, remove the pending action
"waiting-for-supplicant", as it can prevent reaching
"startup-complete".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1004
2024-06-19 11:01:07 +00:00
Beniamino Galvani
6a9f61122e wifi-p2p: implement get_enabled()/set_enabled()
Add function to set and report the rfkill state. For now, only print a
message; the state will be used in the next commit.
2024-06-19 11:01:07 +00:00
Beniamino Galvani
334177bdc3 wifi-p2p: don't add pending action for group interface
The group interface is only used during activation; there is no need
to add a pending action for it, because when the device is in
activating state it already delays "startup-complete" via other
pending actions.
2024-06-19 11:01:07 +00:00
Íñigo Huguet
d4204dc452 merge: branch 'jv/del-unused-logging'
core/logging: remove unused nm_logging_init_pre() function

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1902
2024-06-19 11:00:23 +00:00
Jan Vaclav
1b08fa88e1 core/logging: remove unused nm_logging_init_pre() function
This function is not being used anywhere and is triggering an alert in Coverity scans.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1902
2024-06-19 10:59:56 +00:00
Beniamino Galvani
6c5faf6054 NEWS: update for 1.50 2024-06-19 11:02:02 +02:00
Íñigo Huguet
730752bfc5 merge: branch 'ih/secret_hint_tags'
vpn: handle hint tags in the daemon

Closes #1536

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1958
2024-06-18 14:01:02 +00:00
Íñigo Huguet
18240bb72d libnmc: don't strip prefix tags from secret names
The daemon is now capable of understanding and removing these prefix
tags by itself. It is better than this is not a responsibility of the
secret agent because it requires changes in all secret agents to work
properly (see https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1536).

If the secret agent knows what these prefix tags are, it can remove them
only in the text that is displayed in the UI, but maintaining the
original string as the secret name that is returned to the daemon.

Secret agents that doesn't know what these prefix tags are won't do
anything with them, and they will also return the same string as secret
name, as expected. The only drawback is that they might display the full
string to the user, which is not a nice UX but it will at least work.

Also, allow to translate the secret name for the UI in libnmc.
2024-06-18 14:00:38 +00:00
Íñigo Huguet
0583e1f843 vpn: handle hint tags in the daemon
Commit 345bd1b187 ('libnmc: fix secrets request on 2nd stage of 2FA
authentication') and commit 27c701ebfb ('libnmc: allow user input in
ECHO mode for 2FA challenges') introduced 2 new tags that hints for the
secret agents can have as prefix.

These tags were processed (and removed) in the secret agents, not in the
daemon. This is wrong because a system with an updated VPN plugin but a
not yet updated secret agent (like nm-plasma) will fail: it won't remove
the prefix and the daemon will save the secret with the prefix, i.e.
"x-dynamic-challenge:challenge-response" instead of just
"challenge-response". Then, VPN plugins doesn't recognize it, failing the
profile's activation. This is, in fact, an API break.

Also, if the VPN connection already existed before updating NM and the
VPN plugin, the secret flags are not added to the profile (they are only
added when the profile is created or modified). This causes the user's
first time response is saved to the profile, so the activation fails the
second and next times.

See:
- https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1536
- https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/issues/142

Anyway, in a good design the daemon should contain almost all the logic
and the clients should keep as simple as possible. Fix above's problems
by letting the daemon to receive the secret names with the prefix
already included. The daemon will strip it and will know what it means.

Note that this is done only in the functions that saves the secrets from
the data received via D-Bus. For example, nm_setting_vpn_add_secret
doesn't need to do it because this value shouldn't come from VPN
plugin's hints.
2024-06-18 14:00:38 +00:00
Íñigo Huguet
8f3b4f06bb merge: branch 'ih/triage_wf'
triage: improvements to issues workflow

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1949
2024-06-18 12:22:24 +00:00
Íñigo Huguet
cf86af6cbd Explain new issues workflow and add triage automation
Add explanation of how to indicate the new issues workflow to
MAINTAINERS.md: triage -> investigation -> devel. The different
stages are indicated using Gitlab's scoped labels (mutually exclusive).

These stages try to hightlight that the issue cannot be fixed and it's
not moving forward because more info is needed, already.  Also, add a
section to CONTRIBUTING.md highlighting the importance of helping in
the triage and investigation stages: developers often cannot fix bugs
because lack of time to investigate, but even users that doesn't know
how to fix it due to lack of knowledge of the code base can help thanks
to their knowledge on networking.

Finally, make the 'triage:issues' CI job to work again, adding some
new policies with new automations. The automation will add or remove the
labels: stale, help-needed::{triage, investigation, devel} and
unassigned.

The labels help-needed::* and unassigned will be automatically added to
all issues without an assignee. This reflects better the reality of not
having enough time to work on most of the issues unless there is some
external help.
2024-06-18 13:11:58 +02:00
Lubomir Rintel
1852557a67 release: bump version to 1.48.0 2024-05-31 13:23:57 +02:00
Thomas Haller
41a5cb5308 config: fix crash in assertion during NetworkManager --print-config
Fixes: f6345180b1 ('core/config: fix duplicate entires in `NetworkManager --print-config` output')
(cherry picked from commit 5472f28a40)
2024-05-31 13:06:01 +02:00
Íñigo Huguet
19247325bc po: add nm-setting-generic.c for translation
Translatable strings were added to nm-setting-generic.c. Add this file to
POTFILES.in.

Fixes: 9322c3e9db ('libnm: add generic.device-handler property')
(cherry picked from commit f84282a880)
2024-05-31 13:06:01 +02:00
Íñigo Huguet
de5cce5972 release.sh: stop doing "-dev" releases on stable branches
Note: here I refer to the numbers in a version as MAJOR.MINOR.MICRO.

Having stable and development releases do make sense for the MINOR
version, because we maintain separate branches for them and they
evolve separately. We have 1.47.z where we put all the changes so
anyone can pick the latest development release and test it. At the
same time, we have 1.46.z with the latest stable released version.

However, it does not make sense to have 1.46.2 and 1.46.3-dev because
the latter is not a development version. It is identical to 1.46.2,
only the version number has been bumped, there are no changes to test.
When we add commits, we will be actually testing 1.46.3-dev + some
commits, which is exactly the same as testing 1.46.2 + some commits.

So, basically, someone can use the releases of a development BRANCH,
like 1.47.4, to test the development version of NM. But using a
development MICRO version is exactly the same as using a
non-development one.

From now on, we will just increment the MICRO version each time we do a
release on a stable branch and won't create the '-dev' tag. Update
release.sh to do it this way.

(cherry picked from commit 8eb00c0991)
2024-05-31 13:04:20 +02:00
Lubomir Rintel
017ae2b58a NEWS: not a release candidate any more 2024-05-31 12:59:28 +02:00
Beniamino Galvani
e26b5b06af merge: branch 'bg/vpn'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1938

Resolves: https://issues.redhat.com/browse/RHEL-21875

(cherry picked from commit b8061dd4f6)
2024-05-28 09:50:10 +02:00
Beniamino Galvani
5b4ed809cc vpn: allow IP configurations with routes and without addresses
Usually, when the method is "auto" we want to avoid configuring routes
until the automatic method completes. To achieve that, we clear the
"allow_routes_without_address" flag of l3cds when the method is "auto".

For VPNs, IP configurations with only routes are perfectly valid,
therefore set the flag.

(cherry picked from commit d1ffdb28eb)
2024-05-28 09:50:10 +02:00
Beniamino Galvani
5fa063f90d core: add nm_l3_config_data_set_allow_routes_without_address()
Add a function to set the allow-routes-without-address flag for
l3cds. It will be used in the next commit.

(cherry picked from commit a3ce13c947)
2024-05-28 09:50:10 +02:00
Beniamino Galvani
6897b6ecfd core: rename l3cd's "dhcp_enabled" to "allow_routes_without_address"
The name "dhcp_enabled" is misleading because the flag is set for
method=auto, which doesn't necessarily imply DHCP. Also, it doesn't
convey what the flag is used for. Rename it to
"allow_routes_without_address".

(cherry picked from commit b31febea22)
2024-05-28 09:50:09 +02:00
Beniamino Galvani
518b7c5bd5 vpn: allow IP configurations without addresses
An IPv4-over-IPv6 (or vice-versa) IPsec VPN can return IP
configurations with routes and without addresses. For example, in this
scenario:

         +---------------+         +---------------+
         |  fd01::10/64  <-- VPN -->  fd02::20/64  |
         |     host1     |         |     host2     |
         +-------^-------+         +-------^-------+
                 |                         |
         +-------v-------+         +-------v-------+
         |    subnet1    |         |    subnet2    |
         | 172.16.1.0/24 |         | 172.16.2.0/24 |
         +---------------+         +---------------+

host1 and host2 establish a IPv6 tunnel which encapsulates packets
between the two IPv4 subnets. Therefore, in routed mode, host1 will
need to configure a route like "172.16.2.0/24 via ipsec1" even if the
host doesn't have any IPv4 address on the VPN interface.

Accept IP configurations without address from the VPN; only check that
the address and prefix are sane if they are provided.

(cherry picked from commit 97f185e1f8)
2024-05-28 09:50:09 +02:00
Lubomir Rintel
4f05de07ad release: bump version to 1.47.91 (1.48-rc2) (development) 2024-05-16 21:52:50 +02:00
Íñigo Huguet
b5cb5ffdc3 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.

(cherry picked from commit 7ec363a79a)
2024-05-13 15:45:54 +02:00
Jan Vaclav
05c81123b7 gitlab-ci: update tags 2024-05-09 17:00:19 +02:00
Jan Vaclav
47ffe6a497 merge: branch 'jv/break-autotools'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1931

(cherry picked from commit edb6fa1dd7)
2024-05-09 12:02:13 +02:00
Jan Vaclav
fa747f6478 gitlab-ci: ignore autotools deprecation
We still need the tests to run on autotools builds too, so we must pass the argument.

(cherry picked from commit 5f72b251b1)
2024-05-09 12:00:47 +02:00
Jan Vaclav
17ec5da34a contrib/fedora: update scripts to expect autotools deprecation
(cherry picked from commit 7b4acf938c)
2024-05-09 12:00:14 +02:00
Jan Vaclav
c3a050bad1 build: break autotools configuration to warn about deprecation
We are planning on completely dropping Autotools in the future.
This breaks the build process with an argument to ignore the deprecation,
so that anyone building NM is warned of this change.

(cherry picked from commit d115dcec50)
2024-05-09 12:00:04 +02:00
684 changed files with 59296 additions and 42133 deletions

3
.gitignore vendored
View File

@@ -84,6 +84,9 @@ test-*.trs
/data/org.freedesktop.NetworkManager.policy.in
/data/nm-sudo.service
/data/nm-priv-helper.service
/data/NetworkManager-config-initrd.service
/data/NetworkManager-initrd.service
/data/NetworkManager-wait-online-initrd.service
/docs/api/version.xml
/docs/api/settings-spec.html

View File

@@ -14,7 +14,7 @@
# see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha 98b1218f146a1ec96d65e3ce0041f9a6ec5cb5e6
.templates_sha: &template_sha 593a0a5fe35a523a646a7efae5471c9759b8fba3
@@ -49,6 +49,7 @@ stages:
- tier3
- deploy
- triage
- coverity
variables:
FDO_UPSTREAM_REPO: NetworkManager/NetworkManager
@@ -59,11 +60,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
ALPINE_TAG: 'tag-4cf5505b3b7d'
CENTOS_TAG: 'tag-f78e39f6e045'
DEBIAN_TAG: 'tag-f7bdc50d0819'
FEDORA_TAG: 'tag-f78e39f6e045'
UBUNTU_TAG: 'tag-f7bdc50d0819'
ALPINE_TAG: 'tag-da1ae96102c6'
CENTOS_TAG: 'tag-c8df7d2b249f'
DEBIAN_TAG: 'tag-e68f538711ec'
FEDORA_TAG: 'tag-c8df7d2b249f'
UBUNTU_TAG: 'tag-e68f538711ec'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh'
@@ -82,6 +83,7 @@ variables:
- NetworkManager-1*.tar.xz
- NetworkManager-1*.src.rpm
- nm-test.log
- testlog.txt
.nm_artifacts_debug:
artifacts:
@@ -89,6 +91,7 @@ variables:
when: always
paths:
- nm-test.log
- testlog.txt
#################################################################
# #
@@ -99,31 +102,17 @@ variables:
# Build a container for each distribution + version. The ci-templates
# will re-use the containers if the tag doesn't change.
tier1:fedora:40@prep:
tier1:fedora:42@prep:
extends:
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '42'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
tier2:centos:stream9@prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
- if: $CI_PIPELINE_SOURCE != 'schedule' || $SCHEDULED_PIPELINE_NAME == "weekly"
tier2:fedora:rawhide@prep:
extends:
@@ -139,29 +128,15 @@ tier2:fedora:rawhide@prep:
when: manual
allow_failure: true
tier2:debian:sid@prep:
tier2:centos:stream9@prep:
extends:
- .fdo.container-build@debian
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:debian:testing@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
@@ -181,6 +156,34 @@ tier2:ubuntu:devel@prep:
when: manual
allow_failure: true
tier2:debian:testing@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:debian:sid@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:alpine:edge@prep:
extends:
- .fdo.container-build@alpine
@@ -195,13 +198,13 @@ tier2:alpine:edge@prep:
when: manual
allow_failure: true
tier3:fedora:39@prep:
tier3:fedora:41@prep:
extends:
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '39'
FDO_DISTRIBUTION_VERSION: '41'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC
rules:
@@ -209,13 +212,13 @@ tier3:fedora:39@prep:
when: manual
allow_failure: true
tier3:ubuntu:20.04@prep:
tier3:ubuntu:25.04@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_VERSION: '25.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
@@ -223,13 +226,13 @@ tier3:ubuntu:20.04@prep:
when: manual
allow_failure: true
tier3:ubuntu:22.04@prep:
tier3:ubuntu:24.10@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_VERSION: '24.10'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
@@ -251,13 +254,13 @@ tier3:ubuntu:24.04@prep:
when: manual
allow_failure: true
tier3:ubuntu:rolling@prep:
tier3:ubuntu:22.04@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'rolling'
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
@@ -265,13 +268,13 @@ tier3:ubuntu:rolling@prep:
when: manual
allow_failure: true
tier3:debian:stable@prep:
tier3:debian:12@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stable'
FDO_DISTRIBUTION_VERSION: '12'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
@@ -279,41 +282,41 @@ tier3:debian:stable@prep:
when: manual
allow_failure: true
tier3:debian:oldstable@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'oldstable'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:centos:stream8@prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream8'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:latest@prep:
tier3:alpine:3.21@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'latest'
FDO_DISTRIBUTION_VERSION: '3.21'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:3.20@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.20'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:3.19@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.19'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
@@ -337,7 +340,7 @@ tier3:alpine:latest@prep:
dependencies: []
t_fedora:40:
t_fedora:42:
extends:
- .build@template
- .fdo.distribution-image@fedora
@@ -353,24 +356,10 @@ t_fedora:40:
- tarball
- subtree
variables:
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '42'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier1:fedora:40@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_centos:stream9:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier2:centos:stream9@prep"
- "tier1:fedora:42@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@@ -388,31 +377,17 @@ t_fedora:rawhide:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:sid:
t_centos:stream9:
extends:
- .build@template
- .fdo.distribution-image@debian
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier2:debian:sid@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:testing:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:testing@prep"
- "tier2:centos:stream9@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@@ -430,6 +405,34 @@ t_ubuntu:devel:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:testing:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:testing@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:sid:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:sid@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:edge:
extends:
- .build@template
@@ -444,45 +447,45 @@ t_alpine:edge:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_fedora:39:
t_fedora:41:
extends:
- .build@template
- .fdo.distribution-image@fedora
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '39'
FDO_DISTRIBUTION_VERSION: '41'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier3:fedora:39@prep"
- "tier3:fedora:41@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:20.04:
t_ubuntu:25.04:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '20.04'
FDO_DISTRIBUTION_VERSION: '25.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier3:ubuntu:20.04@prep"
- "tier3:ubuntu:25.04@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:22.04:
t_ubuntu:24.10:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_VERSION: '24.10'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier3:ubuntu:22.04@prep"
- "tier3:ubuntu:24.10@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@@ -500,73 +503,73 @@ t_ubuntu:24.04:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:rolling:
t_ubuntu:22.04:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'rolling'
FDO_DISTRIBUTION_VERSION: '22.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier3:ubuntu:rolling@prep"
- "tier3:ubuntu:22.04@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:stable:
t_debian:12:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'stable'
FDO_DISTRIBUTION_VERSION: '12'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier3:debian:stable@prep"
- "tier3:debian:12@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:oldstable:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'oldstable'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier3:debian:oldstable@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_centos:stream8:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'stream8'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier3:centos:stream8@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:latest:
t_alpine:3.21:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'latest'
FDO_DISTRIBUTION_VERSION: '3.21'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:latest@prep"
- "tier3:alpine:3.21@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.20:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '3.20'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:3.20@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.19:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '3.19'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:3.19@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@@ -580,10 +583,10 @@ check-patch:
extends:
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '42'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier1:fedora:40@prep"
- "tier1:fedora:42@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
stage: tier1
@@ -595,11 +598,15 @@ check-tree:
extends:
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '40'
FDO_DISTRIBUTION_VERSION: '42'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier1:fedora:40@prep"
- "tier1:fedora:42@prep"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_PIPELINE_SOURCE != 'schedule'
stage: tier1
script:
@@ -609,7 +616,7 @@ check-tree:
- date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n
- date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code
- date '+%Y%m%d-%H%M%S'; ./autogen.sh --disable-autotools-deprecation && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
- date '+%Y%m%d-%H%M%S'; meson setup build && [ "$(LANG=C ninja -C build NetworkManager-update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
pages:
stage: deploy
@@ -624,18 +631,39 @@ pages:
when: never
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'main'
dependencies:
- "t_fedora:40: [meson+gcc+docs+valgrind]"
- "t_fedora:42: [meson+gcc+docs+valgrind]"
needs:
- "t_fedora:40: [meson+gcc+docs+valgrind]"
- "t_fedora:42: [meson+gcc+docs+valgrind]"
# triage:issues:
# stage: triage
# image: ruby:2.7
# script:
# - gem install gitlab-triage
# - gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID
# only:
# - schedules
triage:issues:
stage: triage
image: ruby:3
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "daily"
tags:
- placeholder-job # The job mostly waits on network requests, so use only one CPU: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/1358#note_2457416
script:
- gem install gitlab-triage
- gitlab-triage --debug --token $API_TOKEN --source-id $CI_PROJECT_ID
coverity:
extends:
- .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_VERSION: '42'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
stage: coverity
needs:
- "tier1:fedora:42@prep"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
script:
- dnf install -y curl
- CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
- cd build
- ../.gitlab-ci/coverity.sh download
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
- ../.gitlab-ci/coverity.sh upload
# Clean the generated images periodically to get updated snapshots of the distribution images.
# Create an scheduled pipeline to run it, passing an AUTHFILE environment variable of type
@@ -645,7 +673,7 @@ clean-images:
- .fdo.ci-fairy
stage: prep
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
script:
- ci-fairy -v --authfile $AUTHFILE delete-image --project NetworkManager/NetworkManager --all
@@ -654,7 +682,7 @@ clean-images:
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'schedule'

View File

@@ -19,8 +19,8 @@ Regenerate the yml by running `ci-fairy generate-template`.
There are also tests for checking that the yml is correct:
1) run `tools/check-gitlab-ci.sh`
2) run `make check-local-gitlab-ci`, which runs 1). This also
runs as part of `make check`.
2) run `meson test check-local-gitlab-ci`, which runs 1). This also
runs as part of `meson test`.
In both cases, the test is skipped if `ci-fairy` is not in the path.
Install the correct `ci-fairy` version.

View File

@@ -16,7 +16,7 @@
# see https://docs.gitlab.com/ee/ci/yaml/#includefile
.templates_sha: &template_sha 98b1218f146a1ec96d65e3ce0041f9a6ec5cb5e6
.templates_sha: &template_sha 593a0a5fe35a523a646a7efae5471c9759b8fba3
{# Group distros by their common (name,) tuples.#}
{% set distro_groups = [] %}
@@ -53,6 +53,7 @@ stages:
- tier3
- deploy
- triage
- coverity
variables:
FDO_UPSTREAM_REPO: NetworkManager/NetworkManager
@@ -87,6 +88,7 @@ variables:
- NetworkManager-1*.tar.xz
- NetworkManager-1*.src.rpm
- nm-test.log
- testlog.txt
.nm_artifacts_debug:
artifacts:
@@ -94,6 +96,7 @@ variables:
when: always
paths:
- nm-test.log
- testlog.txt
#################################################################
# #
@@ -116,8 +119,10 @@ tier{{distro.tier}}:{{distro.name}}:{{version}}@prep:
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
FDO_DISTRIBUTION_EXEC: ${{distro.name.upper()}}_EXEC
rules:
{% if distro.tier == 1 %}
- if: $CI_PIPELINE_SOURCE != 'schedule' || $SCHEDULED_PIPELINE_NAME == "weekly"
{% else %}
- if: $CI_PIPELINE_SOURCE != 'schedule'
{% if distro.tier > 1 %}
when: manual
allow_failure: true
{% endif %}
@@ -209,6 +214,10 @@ check-tree:
needs:
- "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_PIPELINE_SOURCE != 'schedule'
stage: tier1
script:
@@ -218,7 +227,7 @@ check-tree:
- date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh -n
- date '+%Y%m%d-%H%M%S'; ci-fairy generate-template && git diff --exit-code
- date '+%Y%m%d-%H%M%S'; ./autogen.sh --disable-autotools-deprecation && [ "$(LANG=C make -C po update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
- date '+%Y%m%d-%H%M%S'; meson setup build && [ "$(LANG=C ninja -C build NetworkManager-update-po 2>&1 1>/dev/null | grep -c 'warning:')" = 0 ]
pages:
stage: deploy
@@ -237,14 +246,35 @@ pages:
needs:
- "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [meson+gcc+docs+valgrind]"
# triage:issues:
# stage: triage
# image: ruby:2.7
# script:
# - gem install gitlab-triage
# - gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID
# only:
# - schedules
triage:issues:
stage: triage
image: ruby:3
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "daily"
tags:
- placeholder-job # The job mostly waits on network requests, so use only one CPU: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/1358#note_2457416
script:
- gem install gitlab-triage
- gitlab-triage --debug --token $API_TOKEN --source-id $CI_PROJECT_ID
coverity:
extends:
- .fdo.distribution-image@{{default_distro.name}}
variables:
FDO_DISTRIBUTION_VERSION: '{{default_distro.versions[0]}}'
FDO_DISTRIBUTION_TAG: ${{default_distro.name.upper()}}_TAG
stage: coverity
needs:
- "tier{{default_distro.tier}}:{{default_distro.name}}:{{default_distro.versions[0]}}@prep"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
script:
- dnf install -y curl
- CC=gcc CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
- cd build
- ../.gitlab-ci/coverity.sh download
- cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja
- ../.gitlab-ci/coverity.sh upload
# Clean the generated images periodically to get updated snapshots of the distribution images.
# Create an scheduled pipeline to run it, passing an AUTHFILE environment variable of type
@@ -254,7 +284,7 @@ clean-images:
- .fdo.ci-fairy
stage: prep
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULED_PIPELINE_NAME == "weekly"
script:
- ci-fairy -v --authfile $AUTHFILE delete-image --project NetworkManager/NetworkManager --all
@@ -263,7 +293,7 @@ clean-images:
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'schedule'

View File

@@ -23,55 +23,52 @@ distributions:
- name: fedora
tier: 1
versions:
- '40'
- '42'
# TIER 2: distribution versions that will or might use the current NM version.
# Run when doing a release.
- name: fedora
tier: 2
versions:
- 'rawhide'
- name: centos
tier: 2
versions:
- 'stream9'
- name: fedora
tier: 2
versions:
- rawhide
- name: debian
tier: 2
versions:
- sid
- testing
- name: ubuntu
tier: 2
versions:
- devel
- 'devel'
- name: debian
tier: 2
versions:
- 'testing'
- 'sid'
- name: alpine
tier: 2
versions:
- edge
- 'edge'
# TIER 3: distribution versions not in EOL but don't use the current NM version.
# Run when doing a release, but a failure won't be blocking for the release.
- name: fedora
tier: 3
versions:
- '39'
- '41'
- name: ubuntu
tier: 3
versions:
- '20.04'
- '22.04'
- '25.04'
- '24.10'
- '24.04'
- 'rolling' # latest non-LTS
- '22.04'
- name: debian
tier: 3
versions:
- 'stable'
- 'oldstable'
- name: centos
tier: 3
versions:
- 'stream8'
- '12'
- name: alpine
tier: 3
versions:
- 'latest'
- '3.21'
- '3.20'
- '3.19'

25
.gitlab-ci/coverity.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -e
[ "$COVERITY_SCAN_PROJECT_NAME" = "" ] && echo "missing COVERITY_SCAN_PROJECT_NAME" >&2 && exit 1
[ "$COVERITY_SCAN_TOKEN" = "" ] && echo "missing COVERITY_SCAN_PROJECT_NAME" >&2 && exit 1
if [ "$1" = "download" ]; then
curl https://scan.coverity.com/download/linux64 \
-o /tmp/cov-analysis-linux64.tar.gz \
--form "project=$COVERITY_SCAN_PROJECT_NAME" \
--form "token=$COVERITY_SCAN_TOKEN"
tar xvzf /tmp/cov-analysis-linux64.tar.gz
elif [ "$1" = "upload" ]; then
tar cvzf cov-int.tar.gz cov-int
ls -l cov-int.tar.gz
curl "https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME" \
--form "token=$COVERITY_SCAN_TOKEN" --form "email=$GITLAB_USER_EMAIL" \
--form file=@cov-int.tar.gz --form version="`meson introspect --projectinfo | jq -r .version`" \
--form description="ci run: $CI_COMMIT_TITLE / `git rev-parse --short HEAD`"
rm -rf cov-int*
else
echo "invalid command: $1" >&2
exit 1
fi

141
.gitlab-ci/distros-info.yml Normal file
View File

@@ -0,0 +1,141 @@
# Fedora:
# cadence: every 6 months
# support: 13 months
# Image aliases: latest, rawhide
# Releases and support info: https://docs.fedoraproject.org/en-US/releases/lifecycle/
# NetworkManager versions info: https://src.fedoraproject.org/rpms/NetworkManager
fedora:
- version: rawhide
support: yes
nm: main
- version: 42
support: 2026-05-13
nm: 1.52
tier1-default: yes
- version: 41
support: 2025-11-19
nm: 1.50
# CentOS Stream
centos:
- version: stream9
support: 2027-05-31
nm: main
# RHEL:
# Even minor versions:
# cadence: every year
# support: 2 years EUS + 2 years SAP / Enhaced EUS
# Odd minor versions:
# cadence: every year (every other 6 months than even versions)
# support: 6 months
# Releases and support info: https://access.redhat.com/support/policy/updates/errata
rhel:
- version: 9.6 # not released yet
support: yes
nm: main
- version: 9.5
support: yes
nm: 1.48
- version: 9.4
support: 2026-04-30
extended-support: 2028-04-30
nm: 1.46
- version: 9.2
support: 2025-05-31
extended-support: 2027-05-31
nm: 1.42
- version: 8.10 # last RHEL 8 release, maintenaince support only
support: 2029-05-31
extended-support: no
nm: 1.40
- version: 8.8
support: 2025-05-31
extended-support: 2027-05-31
nm: 1.40
# SAP / Enhaced EUS only:
- version: 9.0
support: 2024-05-31
extended-support: 2026-05-31
nm: 1.36
- version: 8.6
support: 2024-05-31
extended-support: 2026-05-31
nm: 1.36
# Ubuntu:
# LTS:
# cadence: every 2 years
# support: 5 years LTS + 5 years extended security
# non-LTS (rolling):
# cadence: every 6 months
# support: 9 months
# Image aliases: latest (LTS), rolling (LTS or non-LTS), devel
# Releases and support info: https://salsa.debian.org/debian/distro-info-data/-/blob/main/ubuntu.csv
# NetworkManager versions info: https://packages.ubuntu.com/search?keywords=network-manager
ubuntu:
- version: devel
support: yes
nm: main
- version: 25.04
name: plucky
support: 2026-01-15
nm: 1.52
- version: 24.10
name: oracular
support: 2025-07-10
nm: 1.48
- version: 24.04
name: noble
support: 2029-05-31
extended-support: 2034-04-25
nm: 1.46
- version: 22.04
name: jammy
support: 2027-06-01
extended-support: 2032-04-21
nm: 1.36
# Debian:
# cadence: every 2 years
# support: 3 years + 2 years LTS
# Images aliases: testing, sid, stable, oldstable, oldoldstable
# Releases and support info: https://salsa.debian.org/debian/distro-info-data/-/blob/main/debian.csv
# NetworkManager versions info: https://packages.debian.org/search?keywords=network-manager
debian:
- version: testing
support: yes
nm: main
- version: sid
support: yes
nm: main
- version: 12
name: bookworm
support: 2026-06-11
extended-support: 2028-06-30
nm: 1.42
- version: 11
name: bullseye
support: 2024-08-15
extended-support: 2026-08-31
nm: 1.30
# Alpine:
# cadence: every 6 months
# support: 2 years
# Image aliases: latest, edge (development)
# Releases and support info: https://alpinelinux.org/releases/
# NetworkManager versions info (manually select Alpine version): https://pkgs.alpinelinux.org/packages?name=networkmanager&arch=x86_64
alpine:
- version: edge
support: yes
nm: main
- version: 3.21
support: 2026-11-01
nm: 1.50
- version: 3.20
support: 2026-04-01
nm: 1.46
- version: 3.19
support: 2025-11-01
nm: 1.44

234
.gitlab-ci/distros_support.py Executable file
View File

@@ -0,0 +1,234 @@
#!/usr/bin/env python3
import datetime
import os
import sys
try:
import yaml
except ImportError:
print("Error: missing pyyaml. Install with `pip install pyyaml`.", file=sys.stderr)
quit(code=1)
# These are the distros that we currently check, ordered by priority to be chosen as Tier 1
ci_distros = ("fedora", "centos", "debian", "ubuntu", "alpine")
def _parse_date(date_str) -> datetime.date:
return datetime.datetime.strptime(date_str, "%Y-%m-%d").date()
def _is_supported(val_str, today) -> bool:
val_str = val_str.lower()
if val_str in ("yes", "true"):
return True
elif val_str in ("no", "false"):
return False
else:
support_date = _parse_date(val_str)
return today <= support_date
def _nm_version_is_newer(nm_ver, nm_ver_from):
if nm_ver == "main":
return nm_ver_from != "main" # main is newer than anything except main itself
elif nm_ver_from == "main":
return False
nm_ver = nm_ver.split(".")
nm_ver_from = nm_ver_from.split(".")
if int(nm_ver[0]) > int(nm_ver_from[0]):
return True
elif nm_ver[0] == nm_ver_from[0] and int(nm_ver[1]) > int(nm_ver_from[1]):
return True
return False
def _print_usage():
print("Usage: distros_support.py [-a|--all] | <nm_version>")
print(" -a|--all: print NM versions still active in any distro")
print(" nm_version: print all info and config.yml file of the specified NM version")
if len(sys.argv) == 2 and sys.argv[1] in ("-h", "--help", "help"):
_print_usage()
quit()
elif len(sys.argv) > 2:
print("Error: wrong arguments.", file=sys.stderr)
_print_usage()
quit(code=1)
today = datetime.date.today()
with open(os.path.dirname(__file__) + "/distros-info.yml") as f:
distros_info = yaml.load(f, Loader=yaml.BaseLoader)
# Warn about EOL'd distros to remove them
for distro, versions in distros_info.items():
for info in versions:
if _is_supported(info["support"], today):
continue
if "extended-support" in info and _is_supported(
info["extended-support"], today
):
continue
print(
f"Warn: {distro} {info['version']} reached EOL, consider deleting this entry",
file=sys.stderr,
)
# If --all is selected, print all active NM versions and return
if len(sys.argv) < 2 or sys.argv[1] in ("-a", "--all"):
nm_versions = {}
for distro, versions in distros_info.items():
for info in versions:
if not _is_supported(info["support"], today):
continue
nm_versions.setdefault(info["nm"], []).append(f"{distro} {info['version']}")
for nm_ver, distros in sorted(nm_versions.items(), reverse=True):
print("- NM {}: {}".format(nm_ver, ", ".join(distros)))
quit()
# Otherwise, print all the info related to the specified NM version
nm_version = sys.argv[1]
# Print distros that uses this nm_version
print(f"# List of distros using NM {nm_version}")
print("---")
for distro, versions in distros_info.items():
for info in versions:
if nm_version == info["nm"] and _is_supported(info["support"], today):
try:
support_end_date = _parse_date(info["support"])
print(
f"- {distro} {info['version']}, supported until {info['support']}"
)
except ValueError:
print(f"- {distro} {info['version']}, supported")
# Collect info about what distros should be Tier 2 and 3
tier2 = {}
tier3 = {}
for distro, versions in distros_info.items():
if distro not in ci_distros:
continue
for info in versions:
if not _is_supported(info["support"], today):
continue
if nm_version == info["nm"]:
tier2.setdefault(distro, []).append(info["version"])
elif _nm_version_is_newer(nm_version, info["nm"]):
tier3.setdefault(distro, []).append(info["version"])
# Select a Tier1 distro
tier1_distro, tier1_version = "", ""
for fed_ver_info in distros_info["fedora"]:
# We prefer the Fedora version marked as tier1-default
if fed_ver_info.get("tier1-default", False):
for tier in (tier2, tier3):
if fed_ver_info["version"] in tier.get("fedora", []):
tier1_distro = "fedora"
tier1_version = fed_ver_info["version"]
tier["fedora"].remove(fed_ver_info["version"])
if not tier["fedora"]:
del tier["fedora"]
for distro in ci_distros:
if tier1_distro:
break
for tier in (tier2, tier3):
if distro in tier:
# Exception: we want to use fedora:latest instead of fedora:rawhide because
# we don't want lot of build failures in Tier 1, which is run for every MR.
# We just ignore fedora:rawhide for Tier 1.
if distro == "fedora" and tier[distro][0] == "rawhide":
if len(tier[distro]) == 1:
continue
idx = 1
else:
idx = 0
tier1_distro = distro
tier1_version = tier[distro].pop(idx)
if not tier[distro]:
del tier[distro]
break
if not tier1_distro or not tier1_version:
print("Warn: no suitable distro for Tier 1 found", file=sys.stderr)
# Always add CentOS Stream at least as Tier 3
for centos_ver_info in distros_info["centos"]:
version = centos_ver_info["version"]
found = False
if tier1_distro == "centos" and tier1_version == version:
found = True
for tier in (tier2, tier3):
if "centos" in tier and version in tier["centos"]:
found = True
break
if not found:
tier3.setdefault("centos", []).append(version)
# Print the config.yml needed for the corresponding stable branch
branch = "main" if nm_version == "main" else "nm-" + nm_version.replace(".", "-")
print("\n# .gitlab-ci/config.yml for branch '{}'".format(branch))
print(
"""---
# This file contains the configuration for the gitlab ci.
#
# To recreate the .gitlab-ci.yml file, run
# ci-fairy generate-template
#
# The ci-fairy tool is part of
# https://gitlab.freedesktop.org/freedesktop/ci-templates
#
# Some distros are fairly similar, and we reuse similar scripts.
# The base type maps the distro name to their base.
base_types:
fedora: fedora
centos: fedora
debian: debian
ubuntu: debian
alpine: alpine
# The list of all distributions we want to create job for.
distributions:
# TIER 1: CI run for all MRs.
# The first tier:1 in the list is used to build the pages and check-{tree,patch}."""
)
print(" - name: {}".format(tier1_distro))
print(" tier: 1")
print(" versions:")
print(" - '{}'".format(tier1_version))
print(
"""
# TIER 2: distribution versions that will or might use the current NM version.
# Run when doing a release."""
)
for distro, versions in tier2.items():
print(" - name: {}".format(distro))
print(" tier: 2")
print(" versions:")
for version in versions:
print(" - '{}'".format(version))
print(
"""
# TIER 3: distribution versions not in EOL but don't use the current NM version.
# Run when doing a release, but a failure won't be blocking for the release."""
)
for distro, versions in tier3.items():
print(" - name: {}".format(distro))
print(" tier: 3")
print(" versions:")
for version in versions:
print(" - '{}'".format(version))

View File

@@ -39,7 +39,7 @@ fi
fi
NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES
NM_NO_EXTRA=1 NM_INSTALL="yum install -y --allowerasing" ./contrib/fedora/REQUIRED_PACKAGES
yum install -y glibc-langpack-pl ccache clang
# containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html
@@ -66,8 +66,6 @@ else
debuginfo-install -y glib2
fi
contrib/scripts/nm-ci-patch-gtkdoc.sh || true
if [ -x /usr/bin/ninja ] && ! [ -x /usr/bin/ninja-build ]; then
ln -s /usr/bin/ninja-build /usr/bin/ninja
fi

View File

@@ -50,7 +50,7 @@ meson --version
export NMTST_SKIP_CHECK_GITLAB_CI=1
# Assert that "$1" is one of the valid values for NM_TEST_SELECT_RUN. die() otherwise.
check_run_assert() {
is_run_selected_assert() {
{ set +x; } 2>/dev/null
local run="$1"
local a
@@ -83,45 +83,56 @@ check_run_assert() {
}
[ -z "$NM_TEST_SELECT_RUN" ] && NM_TEST_SELECT_RUN=all
check_run_assert "$NM_TEST_SELECT_RUN"
is_run_selected_assert "$NM_TEST_SELECT_RUN"
check_run() {
local test_no="$1"
is_run_selected() {
local run="$1"
check_run_assert "$test_no"
is_run_selected_assert "$run"
# Usually, we run the build several times. However, for testing
# the build script manually, it can be useful to explicitly select
# one step to run. For example, if step 3 is known to fail, you
# can still manually run step A by setting NM_TEST_SELECT_RUN=A.
test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$test_no"
test "$NM_TEST_SELECT_RUN" = all -o "$NM_TEST_SELECT_RUN" = "$run"
}
check_run_clean() {
if ! check_run "$1" ; then
return 1
fi
die_with_testlog() {
mv ./build/meson-logs/testlog.txt ./testlog.txt
exit 1
}
if is_run_selected meson+gcc+docs+valgrind ; then
do_clean
return 0
}
if check_run_clean meson+gcc+docs+valgrind ; then
BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
mv INST/share/gtk-doc/html "$ARTIFACT_DIR/docs-html"
fi
check_run_clean meson+clang && BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
check_run_clean rpm+meson && test $IS_FEDORA = 1 && ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
if is_run_selected meson+clang; then
do_clean
CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh || die_with_testlog
fi
if check_run_clean tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r
if is_run_selected rpm+meson; then
do_clean
if [[ $IS_FEDORA = 1 ]]; then
./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson || die_with_testlog
fi
fi
if is_run_selected tarball && [ "$NM_BUILD_TARBALL" = 1 ]; then
do_clean
SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r || die_with_testlog
mv ./build/meson-dist/NetworkManager-1*.tar.xz "$ARTIFACT_DIR/"
mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm "$ARTIFACT_DIR/"
do_clean
fi
check_run_clean tarball+meson && BUILD_TYPE=meson CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh
if is_run_selected tarball+meson; then
do_clean
CC=gcc WITH_DOCS=1 CONFIGURE_ONLY=1 contrib/scripts/nm-ci-run.sh || die_with_testlog
fi
###############################################################################
@@ -148,7 +159,8 @@ test_subtree() {
popd
}
if check_run_clean subtree; then
if is_run_selected subtree; then
do_clean
for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do
for cc in gcc clang; do
test_subtree "$d" "$cc"
@@ -160,10 +172,10 @@ fi
if [ "$NM_BUILD_TARBALL" = 1 ]; then
do_clean
if check_run meson+gcc+docs+valgrind ; then
if is_run_selected meson+gcc+docs+valgrind ; then
mv "$ARTIFACT_DIR/docs-html/" ./
fi
if check_run tarball ; then
if is_run_selected tarball ; then
mv \
"$ARTIFACT_DIR"/NetworkManager-1*.tar.xz \
"$ARTIFACT_DIR"/NetworkManager-1*.src.rpm \

View File

@@ -1,23 +1,171 @@
# Gitlab-triage documentation: https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/blob/master/README.md
host_url: https://gitlab.freedesktop.org
resource_rules:
issues:
rules:
- name: Set initial workflow stage
conditions:
state: opened
forbidden_labels:
- workflow::triage
- workflow::investigation
- workflow::devel
actions:
labels:
- workflow::triage
- name: Ensure that only one workflow label is used (1/2)
conditions:
state: opened
labels:
- workflow::triage
- workflow::investigation
forbidden_labels:
- workflow::devel
actions:
remove_labels:
- workflow::triage
- name: Ensure that only one workflow label is used (1/2)
conditions:
state: opened
labels:
- workflow::{triage, investigation}
- workflow::devel
actions:
remove_labels:
- workflow::triage
- workflow::investigation
- name: Remove help-needed::* and unassigned labels on assigned issue
conditions:
state: opened
ruby: resource["assignees"].length > 0
labels:
- help-needed::{triage, investigation, devel}
- unassigned
actions:
remove_labels:
- help-needed::triage
- help-needed::investigation
- help-needed::devel
- unassigned
- name: Add help-needed::triage and unassigned labels on unassigned issues
conditions:
state: opened
ruby: resource["assignees"].length == 0
labels:
- workflow::triage
forbidden_labels:
- help-needed::triage
- unassigned
actions:
labels:
- help-needed::triage
- unassigned
- name: Remove wrong help-needed::* labels for issues on triage stage
conditions:
state: opened
labels:
- workflow::triage
- help-needed::{investigation, devel}
actions:
remove_labels:
- help-needed::investigation
- help-needed::devel
- name: Add help-needed::investigation and unassigned labels on unassigned issues
conditions:
state: opened
ruby: resource["assignees"].length == 0
labels:
- workflow::investigation
forbidden_labels:
- help-needed::investigation
- unassigned
actions:
labels:
- help-needed::investigation
- unassigned
- name: Remove wrong help-needed::* labels for issues on investigation stage
conditions:
state: opened
labels:
- workflow::investigation
- help-needed::{triage, devel}
actions:
remove_labels:
- help-needed::triage
- help-needed::devel
- name: Add help-needed::devel and unassigned labels on unassigned issues
conditions:
state: opened
ruby: resource["assignees"].length == 0
labels:
- workflow::devel
forbidden_labels:
- help-needed::devel
- unassigned
actions:
labels:
- help-needed::devel
- unassigned
- name: Remove wrong help-needed::* labels for issues on devel stage
conditions:
state: opened
labels:
- workflow::devel
- help-needed::{triage, investigation}
actions:
remove_labels:
- help-needed::triage
- help-needed::investigation
- name: Remove triage::* labels if the issue is not triaged
conditions:
state: opened
labels:
- workflow::triage
- triaged::{bug, RFE}
actions:
remove_labels:
- triaged::bug
- triaged::RFE
- name: Ensure that only one triaged::* label is used
conditions:
state: opened
labels:
- triaged::bug
- triaged::RFE
actions:
remove_labels:
- triaged::RFE
- name: Mark issue as stale with no activity for 4 months
conditions:
state: opened
date:
attribute: updated_at
condition: older_than
interval_type: months
interval: 4
state: opened
forbidden_labels:
- stale
actions:
comment: |
This issue has been inactive for 4 months and got stale. Contributions welcome to move it forward.
comment: >-
This issue has been inactive for 4 months and got stale.
Contributions welcome to move it forward.
labels:
- stale
- stale
merge_requests:
rules:
- name: Mark merge-request as stale after no activity for 2 months
@@ -31,7 +179,52 @@ resource_rules:
forbidden_labels:
- stale
actions:
comment: |
This merge-request has been inactive for 2 months and got stale. Work is necessary to move it forward.
comment: >-
This merge-request has been inactive for 2 months and got stale.
Work is necessary to move it forward.
labels:
- stale
- stale
- name: Label for MRs authored by core contributors (member_of project)
conditions:
state: opened
forbidden_labels:
- core-contributor
- community-contributor
author_member:
source: project
condition: member_of
source_id: NetworkManager/NetworkManager
actions:
labels:
- core-contributor
- name: Label for MRs authored by core contributors (member_of group)
conditions:
state: opened
forbidden_labels:
- core-contributor
- community-contributor
author_member:
source: group
condition: member_of
source_id: NetworkManager
actions:
labels:
- core-contributor
- name: Label for MRs authored by community contributors and ensure CI is run
conditions:
state: opened
forbidden_labels:
- core-contributor
- community-contributor
actions:
labels:
- community-contributor
comment_type: thread
comment: >-
Attention maintainers: remember to run the CI!!
This MR is authored by a contributor from the community and the CI does not
run automatically.

View File

@@ -33,8 +33,35 @@ and you still need to review them. You can also personally hand over the logfile
to a NM developer to treat it confidential.
Contribute
----------
Help with issues triage
-----------------------
The big amount of reported issues is difficult to handle by the small team of
developers actively working on the project. Many bugs remain unfixed because
there is no enough time to investigate them.
Working on issues triage and investigation is a very useful help that many
people can provide very effectively, even if they can't do the fix in the
code afterwards.
This is the kind of help that may facilitate other developers to prepare a fix:
- Investigate if it's a real bug or if it's expected behaviour.
- Provide information and context to explain why it is a bug and what the
expected behaviour would be.
- Create reproducers.
- Investigate where the failure might be in the code, even if you don't know
how to fix it.
- In a general sense, provide any information that might be useful later.
Find issues with the `help-needed::triage` and `help-needed::investigation`
label in our [issue tracker](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues)
and help with them. Issues in "investigation" stage has been triaged, i.e.
identified as a bug, but there is not enough information to start working on it
yet.
Contribute patches
------------------
Send patches to our repository at [gitlab.freedesktop.org](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/).
If you are willing to contribute, please read these guidelines first:
@@ -43,11 +70,8 @@ If you are willing to contribute, please read these guidelines first:
- Work on any issue you want, but please put a comment to indicate that you are
willing to work on it so others don't do the same work in parallel, or to
check whether anyone is already doing so.
- Issues marked as `help-wanted` are those where the NetworkManager developers
are explicitly asking for contributors' help, probably due to lack of capacity
to work on it.
check whether anyone is already doing so. You can find issues waiting for a
developer to work on it searching for the `help-needed::devel` label.
- Issues marked as `good-first-issue` indicate that they are probably quite
simple fixes, well suited for first time contributors.
@@ -232,14 +256,13 @@ maintained by the upstream maintainers. There you find builds of latest `main` a
Unit Tests
----------
We have plenty of unit tests. Run them with `make check` or
`meson test -C build`.
We have plenty of unit tests. Run them with `meson test -C build`.
Note that some files in the source tree are both generated and commited
to git. That means, certain changes to the code also affect these generated
files. The unit test fail in that case, to indicate that the generated
files no longer match what is commited to git.
You can also automatically regenerate the files by running `NM_TEST_REGENERATE=1 make check`.
You can also automatically regenerate the files by running `NM_TEST_REGENERATE=1 meson test`.
Note that test-client requires working translation.
See the [comment](src/tests/client/test-client.py#L14)
for how to configure it.
@@ -392,7 +415,7 @@ have `-I. -I./src/` in their build arguments. So to include a header like
[`src/libnm-glib-aux/nm-random-utils.h`](src/libnm-glib-aux/nm-random-utils.h)
you'd do `#include "libnm-glib-aux/nm-random-utils.h"`.
Note that there are exceptions. For example, `src/libnm-std-aux/nm-linux-compat.h`](src/libnm-std-aux/nm-linux-compat.h)
Note that there are exceptions. For example, [`src/libnm-std-aux/nm-linux-compat.h`](src/libnm-std-aux/nm-linux-compat.h)
may need to be included before system headers as it is supposed to include headers
from `src/linux-headers`](src/linux-headers).

View File

@@ -6,38 +6,51 @@ Issue tracker: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/is
Help other maintainers with the triage following these guidelines. This way, it
will be easier to find issues that require attention.
- Assign an issue to yourself if you are going to take care of providing the
required help. Assign it to another person if he/she is more suitable to help,
but do this quite rarely so we take care of not overloading to anyone.
- Workflow: indicate the current stage with the corresponding label:
- Add suitable labels to indicate the state of open issues:
- `workflow::triage`: needs triage to determine whether is a bug, an RFE or we
should close it.
- `workflow::investigation`: has been triaged but more info is needed to start
working on a fix. This step can be skipped if enough information is provided
during triage.
- `workflow::devel`: on development (or waiting for it).
- Closed: the issue is already solved, either via a code fix or via providing
the required info. Also if the request is clearly incorrect or doesn't fit
at all in the project.
- Assignee: assign the issue to the person that is working on it. This will
remove the `unassigned` and `help-needed::*` labels.
- Manual labels: add suitable labels to indicate the state of open issues:
- `need-info`: waiting for info or feedback from anyone.
- `good-first-issue`: the task is simple and well suited for a first time
contributor.
- `triaged::bug` / `triaged::RFE`: type of issue.
- `need-discussion`: something is not clear about what to do, or about if
something has to be done at all. The problem should be discussed by the
maintainers and/or with the reporter and/or other interested parts.
- `triaged`: if the problem is properly explained and understood. Add also
one of the labels `bug` or `RFE` as corresponds.
- `help-wanted`: request external contributors to work on this. If it's a
simple fix, add `good-first-issue` too.
- `work-in-progress`: anyone is already working on a Merge Request, so others.
- `blocked`: the issue is waiting for something that blocks its progress
- `close-proposed`: there are good reasons to reject the request (explain
those reasons when adding the label). If after a reasonable time there is no
additional info that is good enouch to reconsider it, the issue will be
closed.
It is not mandatory to always use this tag before closing an issue, but
usually desirable.
those reasons when adding the label) but a chance to others to provide
reasons against it is desired.
It is not mandatory to always use this tag.
- `Spam`: mark as spam, blocking the author. See [damspam](https://gitlab.freedesktop.org/freedesktop/damspam/-/blob/main/README.md?ref_type=heads).
- Close an issue if the problem is already solved, either via a code fix or via
some information that has been provided. Also if the request is clearly
incorrect or doesn't fit at all in the project.
- Automatic labels: some labels are automatically added and removed by a bot and
the maintainers don't need to care much about them. The label `stale` is
used for issues without activity for a long time. The labels `unassigned` and
`help-needed::{triage, investigation, devel}` are used for issues without an
assignee.
Merging Merge Requests
@@ -178,7 +191,9 @@ release type that you specify, like devel, rc1, rc, major, major-post, etc.
Run the script with `--help` to see all options.
Notes:
- You need access to master.gnome.org, see [here](https://handbook.gnome.org/infrastructure/accounts.html).
- You need a private token from gitlab.freedesktop.org with 'api' level access
to the project. It can be saved to `~/.config/nm-release-token` or passed to
the `--gitlab-token` argument of `release.sh`.
- The GPG key used to sign the tags must be exported to a keyserver.
Versioning scheme, automatically handled by the script (version numbers are
@@ -190,7 +205,7 @@ called MAJOR.MINOR.MICRO):
number less, and MICRO is >= 90).
The main differences between the different kind of releases are:
- Development releases: for depelopment and testing purposes only.
- Development releases: for development and testing purposes only.
- Release candidates (RC): stabilization phase before a stable release. Normally
there are one or two RCs with ~2 weeks cadence. More RCs can be releases if
they are needed.
@@ -239,10 +254,10 @@ Versioning scheme (version numbers are called MAJOR.MINOR.MICRO):
When doing a release, follow this process:
1. Ensure that `NEWS` file is up to date.
2. Increment the version in `configure.ac`, commit and tag the commit. Example:
2. Increment the version in `meson.build`, commit and tag the commit. Example:
`git tag -s 1.2.8 -m 'Tag 1.2.8'`.
3. Ensure that you are on the right commit and create the tarball:
`git clean -fdx && ./autogen.sh && make distcheck`
`git clean -fdx && meson setup build && cd build && meson dist`
4. Upload the tarball: `scp ./*-*.tar.xz "$user@master.gnome.org:"`
5. Login to `master.gnome.org` and run `ftpadmin install`.
Ensure the new tarballs show up at https://download.gnome.org/sources/

File diff suppressed because it is too large Load Diff

View File

@@ -1,221 +0,0 @@
###############################################################################
# examples/C/glib
###############################################################################
examples_C_glib_cppflags = \
-I$(top_srcdir)/src/libnm-core-public \
-I$(top_builddir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-client-public \
-I$(top_builddir)/src/libnm-client-public \
$(GLIB_CFLAGS)
examples_C_glib_cppflags_gdbus = $(examples_C_glib_cppflags)
examples_C_glib_cppflags_libnm = $(examples_C_glib_cppflags)
check_programs_norun += \
examples/C/glib/add-connection-gdbus \
examples/C/glib/add-connection-libnm \
examples/C/glib/get-active-connections-gdbus \
examples/C/glib/get-ap-info-libnm \
examples/C/glib/list-connections-gdbus \
examples/C/glib/list-connections-libnm \
examples/C/glib/monitor-nm-running-gdbus \
examples/C/glib/monitor-nm-state-gdbus \
examples/C/glib/vpn-import-libnm \
$(NULL)
examples_C_glib_add_connection_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_add_connection_gdbus_LDADD = \
$(GLIB_LIBS) \
$(UUID_LIBS)
$(examples_C_glib_add_connection_gdbus_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_add_connection_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_add_connection_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_add_connection_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_get_active_connections_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_get_active_connections_gdbus_LDADD = \
$(GLIB_LIBS)
$(examples_C_glib_get_active_connections_gdbus_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_get_ap_info_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_get_ap_info_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_get_ap_info_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_list_connections_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_list_connections_gdbus_LDADD = \
$(GLIB_LIBS)
examples_C_glib_list_connections_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_list_connections_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_list_connections_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
examples_C_glib_monitor_nm_running_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_monitor_nm_running_gdbus_LDADD = \
$(GLIB_LIBS)
examples_C_glib_monitor_nm_state_gdbus_CPPFLAGS = $(examples_C_glib_cppflags_gdbus)
examples_C_glib_monitor_nm_state_gdbus_LDADD = \
$(GLIB_LIBS)
examples_C_glib_vpn_import_libnm_CPPFLAGS = $(examples_C_glib_cppflags_libnm)
examples_C_glib_vpn_import_libnm_LDADD = \
src/libnm-client-impl/libnm.la \
$(GLIB_LIBS)
$(examples_C_glib_vpn_import_libnm_OBJECTS): $(src_libnm_core_public_mkenums_h) $(src_libnm_client_public_mkenums_h)
EXTRA_DIST += \
examples/C/glib/meson.build
###############################################################################
# examples/C/qt
###############################################################################
if WITH_QT
examples_C_qt_cppflags = \
-I$(top_builddir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-core-public \
-I$(top_builddir)/libnm \
-I$(top_srcdir)/libnm \
-I$(builddir)/examples/C/qt \
$(DBUS_CFLAGS) \
$(QT_CFLAGS)
check_programs_norun += \
examples/C/qt/add-connection-wired \
examples/C/qt/list-connections \
examples/C/qt/change-ipv4-addresses \
examples/C/qt/monitor-nm-running
examples_C_qt_add_connection_wired_SOURCES = examples/C/qt/add-connection-wired.cpp
examples_C_qt_add_connection_wired_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_add_connection_wired_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples_C_qt_list_connections_SOURCES = examples/C/qt/list-connections.cpp
examples_C_qt_list_connections_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_list_connections_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples_C_qt_change_ipv4_addresses_SOURCES = examples/C/qt/change-ipv4-addresses.cpp
examples_C_qt_change_ipv4_addresses_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_change_ipv4_addresses_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples_C_qt_monitor_nm_running_SOURCES = examples/C/qt/monitor-nm-running.cpp
examples_C_qt_monitor_nm_running_CPPFLAGS = $(examples_C_qt_cppflags)
examples_C_qt_monitor_nm_running_LDADD = \
$(DBUS_LIBS) \
$(QT_LIBS)
examples/C/qt/monitor-nm-running.moc: examples/C/qt/monitor-nm-running.cpp
$(AM_V_GEN) $(MOC) -i $< -o $@
$(examples_C_qt_monitor_nm_running_OBJECTS): examples/C/qt/monitor-nm-running.moc
CLEANFILES += \
examples/C/qt/monitor-nm-running.moc
endif
EXTRA_DIST += \
examples/C/qt/add-connection-wired.cpp \
examples/C/qt/list-connections.cpp \
examples/C/qt/change-ipv4-addresses.cpp \
examples/C/qt/monitor-nm-running.cpp \
examples/C/qt/meson.build
###############################################################################
# examples
###############################################################################
EXTRA_DIST += \
examples/dispatcher/10-ifcfg-rh-routes.sh \
examples/dispatcher/70-wifi-wired-exclusive.sh \
\
examples/js/get_ips.js \
\
examples/lua/lgi/add-connection.lua \
examples/lua/lgi/change-vpn-username.lua \
examples/lua/lgi/deactivate-all.lua \
examples/lua/lgi/get-basic-nm-info.lua \
examples/lua/lgi/get-ips.lua \
examples/lua/lgi/list-connections.lua \
examples/lua/lgi/list-devices.lua \
examples/lua/lgi/show-wifi-networks.lua \
\
examples/nm-conf.d/30-anon.conf \
examples/nm-conf.d/31-mac-addr-change.conf \
\
examples/python/dbus/add-connection-compat.py \
examples/python/dbus/add-connection.py \
examples/python/dbus/add-wifi-eap-connection.py \
examples/python/dbus/add-wifi-psk-connection.py \
examples/python/dbus/add-wifi-sae-connection.py \
examples/python/dbus/checkpoint.py \
examples/python/dbus/create-bond.py \
examples/python/dbus/disconnect-device.py \
examples/python/dbus/get-active-connection-uuids.py \
examples/python/dbus/is-wwan-default.py \
examples/python/dbus/list-connections.py \
examples/python/dbus/list-devices.py \
examples/python/dbus/nm-state.py \
examples/python/dbus/show-bssids.py \
examples/python/dbus/update-ip4-method.py \
examples/python/dbus/update-secrets.py \
examples/python/dbus/vpn.py \
examples/python/dbus/wifi-active-ap.py\
examples/python/dbus/wifi-hotspot.py \
\
examples/python/gi/README \
examples/python/gi/add_connection.py \
examples/python/gi/checkpoint.py \
examples/python/gi/deactivate-all.py \
examples/python/gi/device-reapply.py \
examples/python/gi/device-state-ip4config.py \
examples/python/gi/dns.py \
examples/python/gi/firewall-zone.py \
examples/python/gi/get-active-connections.py \
examples/python/gi/get-devices.py \
examples/python/gi/get-interface-flags.py \
examples/python/gi/get-lldp-neighbors.py \
examples/python/gi/get_ips.py \
examples/python/gi/gmaincontext.py \
examples/python/gi/list-connections.py \
examples/python/gi/nm-add-connection2.py \
examples/python/gi/nm-connection-update-stable-id.py \
examples/python/gi/nm-keyfile.py \
examples/python/gi/nm-up-many.py \
examples/python/gi/nm-update2.py \
examples/python/gi/nm-wg-set \
examples/python/gi/ovs-external-ids.py \
examples/python/gi/setting-user-data.py \
examples/python/gi/show-wifi-networks.py \
examples/python/gi/update-ip4-method.py \
examples/python/gi/vpn-import.py \
examples/python/gi/wifi-p2p.py \
\
examples/python/python-networkmanager/README \
\
examples/ruby/add-connection.rb \
examples/ruby/get-basic-nm-info.rb \
examples/ruby/list-devices.rb \
\
examples/shell/active-wifi.sh \
examples/shell/disconnect-device.sh \
examples/shell/get-hostname.sh \
examples/shell/list-devices.sh \
examples/shell/nm-logging.sh \
\
$(NULL)

View File

@@ -1,168 +0,0 @@
#
# Work-in-progress...
# See https://bugzilla.gnome.org/show_bug.cgi?id=654395
_GLIB_CLEANFILES =
_GLIB_DISTCLEANFILES =
_GLIB_V_GEN = $(_glib_v_gen_$(V))
_glib_v_gen_ = $(_glib_v_gen_$(AM_DEFAULT_VERBOSITY))
_glib_v_gen_0 = @echo " GEN " $(subst .stamp,,$@);
### glib-genmarshal
_GLIB_MARSHAL_GENERATED = $(subst .h,,$(filter %marshal.h,$(GLIB_GENERATED)))
_glib_marshal_prefix = $(subst marshal,,$(subst _marshal,,$(subst -,_,$(notdir $(1)))))_marshal
_glib_marshal_sources_var = $(subst -,_,$(notdir $(1)))_sources
_glib_marshal_sources = $(filter-out %.h,$(filter-out $(GLIB_GENERATED),$($(_glib_marshal_sources_var))))
define _glib_make_genmarshal_rules
$(if $(_glib_marshal_sources),,$(error Need to define $(_glib_marshal_sources_var) for $(1).[ch]))
$(1).list.stamp: $(_glib_marshal_sources) Makefile
$$(_GLIB_V_GEN) LC_ALL=C sed -ne 's/.*_$(_glib_marshal_prefix)_\([_A-Z]*\).*/\1/p' $$(filter-out Makefile, $$^) | sort -u | sed -e 's/__/:/' -e 's/_/,/g' > $(1).list.tmp && \
(cmp -s $(1).list.tmp $(1).list || cp $(1).list.tmp $(1).list) && \
rm -f $(1).list.tmp && \
echo timestamp > $$@
$(1).list: $(1).list.stamp
@true
$(1).h: $(1).list
$$(_GLIB_V_GEN) $$(GLIB_GENMARSHAL) \
--prefix=_$(_glib_marshal_prefix) --header \
$$(GLIB_GENMARSHAL_H_FLAGS) \
$$($(_glib_marshal_prefix)_GENMARSHAL_H_FLAGS) \
$$< > $$@.tmp && \
mv $$@.tmp $$@
$(1).c: $(1).list
$$(_GLIB_V_GEN) (echo "#include \"$$(subst .c,.h,$$(@F))\""; $$(GLIB_GENMARSHAL) \
--prefix=_$(_glib_marshal_prefix) --body \
$$(GLIB_GENMARSHAL_C_FLAGS) \
$$($(_glib_marshal_prefix)_GENMARSHAL_C_FLAGS) \
$$< ) > $$@.tmp && \
mv $$@.tmp $$@
_GLIB_CLEANFILES += $(1).list.stamp $(1).list
_GLIB_DISTCLEANFILES += $(1).h $(1).c
endef
$(foreach f,$(_GLIB_MARSHAL_GENERATED),$(eval $(call _glib_make_genmarshal_rules,$f)))
### glib-mkenums
_GLIB_ENUM_TYPES_GENERATED = $(subst .h,,$(filter %enum-types.h %enumtypes.h,$(GLIB_GENERATED)))
_glib_enum_types_prefix = $(subst -,_,$(notdir $(1)))
_glib_enum_types_guard = __$(shell LC_ALL=C echo $(_glib_enum_types_prefix) | tr 'a-z' 'A-Z')_H__
_glib_enum_types_sources_var = $(_glib_enum_types_prefix)_sources
_glib_enum_types_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enum_types_sources_var)))
_glib_enum_types_h_sources = $(filter %.h,$(_glib_enum_types_sources))
define _glib_make_mkenums_rules
$(if $(_glib_enum_types_sources),,$(error Need to define $(_glib_enum_types_sources_var) for $(1).[ch]))
$(1).h.stamp: $(_glib_enum_types_h_sources) Makefile
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#ifndef $(_glib_enum_types_guard)\n#define $(_glib_enum_types_guard)\n\n" \
$$(GLIB_MKENUMS_H_FLAGS) \
$$($(_glib_enum_types_prefix)_MKENUMS_H_FLAGS) \
--fhead "#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \
--ftail "G_END_DECLS\n\n#endif /* $(_glib_enum_types_guard) */" \
$$(filter-out Makefile, $$^) > $(1).h.tmp && \
(cmp -s $(1).h.tmp $(1).h || cp $(1).h.tmp $(1).h) && \
rm -f $(1).h.tmp && \
echo timestamp > $$@
$(1).h: $(1).h.stamp
@true
$(1).c.stamp: $(_glib_enum_types_h_sources) Makefile
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
--fhead "/* Generated by glib-mkenums. Do not edit */\n\n#include \"config.h\"\n\n#include \"$(notdir $(1)).h\"\n" \
$$(GLIB_MKENUMS_C_FLAGS) \
$$($(_glib_enum_types_prefix)_MKENUMS_C_FLAGS) \
--fhead "$$(foreach f,$$(filter-out Makefile,$$(^F)),\n#include \"$$(f)\")\n\n" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" },\n" \
--vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n" \
$$(filter-out Makefile, $$^) > $(1).c.tmp && \
(cmp -s $(1).c.tmp $(1).c || cp $(1).c.tmp $(1).c) && \
rm -f $(1).c.tmp && \
echo timestamp > $$@
$(1).c: $(1).c.stamp
@true
_GLIB_CLEANFILES += $(1).h.stamp $(1).c.stamp
_GLIB_DISTCLEANFILES += $(1).h $(1).c $(1).h.stamp $(1).c.stamp
endef
$(foreach f,$(_GLIB_ENUM_TYPES_GENERATED),$(eval $(call _glib_make_mkenums_rules,$f)))
### glib-compile-schemas
_GLIB_ENUMS_XML_GENERATED = $(filter %.enums.xml,$(GLIB_GENERATED))
_GLIB_GSETTINGS_SCHEMA_FILES = $(filter %.gschema.xml,$(gsettingsschema_DATA))
_GLIB_GSETTINGS_VALID_FILES = $(subst .xml,.valid,$(_GLIB_GSETTINGS_SCHEMA_FILES))
_glib_enums_xml_prefix = $(subst .,_,$(notdir $(1)))
_glib_enums_xml_sources_var = $(_glib_enums_xml_prefix)_sources
_glib_enums_xml_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enums_xml_sources_var)))
_glib_enums_xml_namespace = $(subst .enums.xml,,$(notdir $(1)))
define _glib_make_enums_xml_rule
$(if $(_glib_enums_xml_sources),,$(error Need to define $(_glib_enums_xml_sources_var) for $(1)))
$(1): $(_glib_enums_xml_sources) Makefile
$$(_GLIB_V_GEN) $$(GLIB_MKENUMS) --comments '<!-- @comment@ -->' --fhead "<schemalist>" --vhead " <@type@ id='$(_glib_enums_xml_namespace).@EnumName@'>" --vprod " <value nick='@valuenick@' value='@valuenum@'/>" --vtail " </@type@>" --ftail "</schemalist>" $$(filter-out Makefile, $$^) > $$@.tmp && mv $$@.tmp $$@
endef
_GLIB_V_CHECK = $(_glib_v_check_$(V))
_glib_v_check_ = $(_glib_v_check_$(AM_DEFAULT_VERBOSITY))
_glib_v_check_0 = @echo " CHECK " $(subst .valid,.xml,$@);
define _glib_make_schema_validate_rule
$(subst .xml,.valid,$(1)): $(_GLIB_ENUMS_XML_GENERATED) $(1)
$$(_GLIB_V_CHECK) $$(GLIB_COMPILE_SCHEMAS) --strict --dry-run $$(addprefix --schema-file=,$$^) && touch $$@
endef
define _glib_make_schema_rules
all-am: $(_GLIB_GSETTINGS_VALID_FILES)
install-data-am: glib-install-schemas-hook
glib-install-schemas-hook: install-gsettingsschemaDATA
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
uninstall-am: glib-uninstall-schemas-hook
glib-uninstall-schemas-hook: uninstall-gsettingsschemaDATA
@test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
.PHONY: glib-install-schemas-hook glib-uninstall-schemas-hook
endef
_GLIB_CLEANFILES += $(_GLIB_ENUMS_XML_GENERATED) $(_GLIB_GSETTINGS_VALID_FILES)
$(foreach f,$(_GLIB_ENUMS_XML_GENERATED),$(eval $(call _glib_make_enums_xml_rule,$f)))
$(foreach f,$(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(call _glib_make_schema_validate_rule,$f)))
$(if $(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(_glib_make_schema_rules)))
### Cleanup
.PHONY: clean-glib distclean-glib
clean-am: clean-glib
clean-glib:
$(if $(strip $(_GLIB_CLEANFILES)),-rm -f $(_GLIB_CLEANFILES))
distclean-am: distclean-glib
distclean-glib:
$(if $(strip $(_GLIB_DISTCLEANFILES)),-rm -f $(_GLIB_DISTCLEANFILES))

View File

@@ -1,62 +0,0 @@
# Makefile for Vala API Generator (vapigen)
# Written by Evan Nemerson
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
#
# Variables:
#
# VAPIGEN_FILES
#
# VAPIs to create
#
# *_DEPS / VAPIGEN_DEPS
#
# The dependencies. Generally the pkg-config names.
#
# *_METADATADIRS / VAPIGEN_METADATADIRS
#
# Directory containing the metadata.
#
# *_VAPIDIRS / VAPIGEN_VAPIDIRS
#
# Additional location(s) to search for VAPI dependencies.
#
# *_GIRDIRS / VAPIGEN_GIRDIRS
#
# Additional location(s) to search for GIR dependencies.
#
# *_FILES
#
# The files which should be used to generate the VAPI.
_vapigen_silent_prefix = $(_vapigen_silent_prefix_$(V))
_vapigen_silent_prefix_ = $(_vapigen_silent_prefix_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_prefix_0 = @echo " VAPIGEN $(1)";
_vapigen_silent_opts = $(_vapigen_silent_opts_$(V))
_vapigen_silent_opts_ = $(_vapigen_silent_opts_$(AM_DEFAULT_VERBOSITY))
_vapigen_silent_opts_0 = --quiet
_vapi_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1))))
define vapigen
$(1): $$($(_vapi_name)_GIR)
$(_vapigen_silent_prefix) \
G_DEBUG='' \
$(VAPIGEN) $(_vapigen_silent_opts) \
--library $(1:.vapi=) \
$(foreach _vapi_metadatadir_name,$(if $($(_vapi_name)_METADATADIRS),$($(_vapi_name)_METADATADIRS),$(VAPIGEN_METADATADIRS)),--metadatadir $(_vapi_metadatadir_name)) \
$(foreach _vapi_dir_name,$(if $($(_vapi_name)_VAPIDIRS),$($(_vapi_name)_VAPIDIRS),$(VAPIGEN_VAPIDIRS)),--vapidir $(_vapi_dir_name)) \
$(foreach _vapi_gir_dir,$(if $($(_vapi_name)_GIRDIRS),$($(_vapi_name)_GIRDIRS),$(VAPIGEN_GIRDIRS)),--girdir $(_vapi_gir_dir)) \
$(foreach _vapi_dep_name,$(if $($(_vapi_name)_DEPS),$($(_vapi_name)_DEPS),$(VAPIGEN_DEPS)),--pkg $(_vapi_dep_name)) \
$$($(_vapi_name)_FILES) && \
touch $(1)
endef
$(foreach vapi,$(VAPIGEN_VAPIS),$(eval $(call vapigen,$(vapi))))

119
NEWS
View File

@@ -1,6 +1,6 @@
=============================================
NetworkManager-1.48
Overview of changes since NetworkManager-1.46
NetworkManager-1.56
Overview of changes since NetworkManager-1.54
=============================================
This is a snapshot of NetworkManager development. The API is
@@ -8,6 +8,105 @@ subject to change and not guaranteed to be compatible with
the later release.
USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
* nmcli now supports viewing and managing WireGuard peers.
=============================================
NetworkManager-1.54
Overview of changes since NetworkManager-1.52
=============================================
* Add support for configuring per-device IPv4 forwarding via the
"ipv4.forwarding" connection property.
* Add a new "prefix-delegation" setting containing a "subnet-id"
property that specifies the subnet to choose on the downstream
interface when using IPv6 prefix delegation.
* Support OCI baremetal in nm-cloud-setup
* When activating a WireGuard connection to an IPv6 endpoint, now
NetworkManager creates firewall rules to ensure that the incoming
packets are not dropped by kernel reverse path filtering.
* Add support for configuring the loopback interface in nmtui.
* Most of the properties of ovs-bridge and ovs-port connections can
now be reapplied at runtime without bringing the connection down.
* Add a new "sriov.preserve-on-down" property that controls whether
NetworkManager preserves the SR-IOV parameters set on the device
when the connection is deactivated, or whether it resets them to
their default value.
* Introduce a new "ovs-dpdk.lsc-interrupt" property to configure the
Link State Change (LSC) detection mode for OVS DPDK interfaces.
* The initrd-generator now can parse the NVMe Boot Firmware Table
(NBFT) to configure networking during early boot.
* Add systemd services to provide networking in the initrd.
=============================================
NetworkManager-1.52
Overview of changes since NetworkManager-1.50
=============================================
* Store interactive history in `$XDG_CACHE_HOME/nmcli-history` instead of
`~/.nmcli-history`
* Add new ipv4.link-local=fallback to set an IPv4 link-local address
when no other IPv4 is set.
* Remove support for building with Autotools
* Add IPVLAN interface support
* Allow to manually configure the authentication of LTE's initial EPS Bearer.
* Add support for the "IPv6-only preferred" DHCPv4 option (RFC 8925),
used to indicate that a host supports an IPv6-only mode and is
willing to forgo obtaining an IPv4 address if the network provides
IPv6 connectivity.
* Support automatically adding routes to DNS servers via the
ipv4.routed-dns and ipv6.routed-dns properties; when enabled, each
name server is reached only via the device that specifies it.
* Support OCI in nm-cloud-setup
* Added support for ethtool FEC mode
* Add new ipv4.shared-dhcp-range and ipv4.shared-dhcp-lease-time,
which allows you to customize the DHCP range and lease time offered
by DHCP server in `shared` connection method.
* DNS servers can now be specified with a URI-like syntax which supports
DNS over TLS name servers.
* The initrd-generator understands the "rd.net.dns" option to configure
global name servers.
* Drop support for the "dhcpcanon" DHCP client.
* global-dns configuration section now has 2 additional keys: "resolve-mode"
and "certification-authority".
* Dnsconfd plugin can now be used for configuration of system-wide DNS
caching resolver. If dnsconfd plugin is enabled and ipvX.routed-dns is
set to -1 then adding routes is by default enabled.
* Add "shared" method to the IPv6 configuration options in nmtui.
* Fix a bug that prevented the activation of bond and bridge's ports in some cases
* Fix a bug that prevented the activation of OVS interfaces in some cases
* Fix MTPCP endpoint creation for IPv4 with DAD and IPv6 tentative addresses
* Fix some VPN routes not being added to the table specified in ipv4/6.routing-table.
This fix allow to use policy routing to mitigate Tunnelvision attacks.
=============================================
NetworkManager-1.50
Overview of changes since NetworkManager-1.48
=============================================
* The support for "dhclient" has been deprecated, not built unless
explicitely enabled, and will be removed in a future release.
The internal DHCP client should be used instead and has been
the default since version 1.20 (1.12 when built with meson).
* Support matching a OVS system interface by MAC address.
* Add a timeout option to connectivity checking.
* Support configuring veth interfaces in nmtui.
* When looking up the system hostname from the reverse DNS lookup of
addresses configured on interfaces, NetworkManager now takes into
account the content of /etc/hosts.
* Revert to using sysctl ipv6.conf.default for ip6-privacy
* Allow specifying a system OVS interface by MAC address
* ndisc: Support multiple gateways for a single network
* wifi: Support configuring channel-width in AP mode
* keyfile: Stop writing offensive terms into keyfiles
* Support reapplying the VLANs on bridge ports.
* Fix crash caused by malformed LLDP package if debug log is enabled
* Retry hostname resolution when it fails
=============================================
NetworkManager-1.48
Overview of changes since NetworkManager-1.46
=============================================
* Building with autotools is now deprecated and will be completely removed
in the next development cycle. We recommend using meson to build
NetworkManager -- for basic setup, see the CONTRIBUTING.md file.
@@ -131,7 +230,7 @@ Overview of changes since NetworkManager-1.42
lead to unexpected behaviors in case of multiconnect profiles.
* Set VLAN filtering options on bridge via netlink instead of sysfs.
* nm-cloud-setup now supports IMDSv2 on Amazon EC2.
* nmtui now allows to enable or disable Wi-Fi and WWAN radios.
* nmtui now supports enabling/disabling Wi-Fi and WWAN radios.
* Honor ignore-carrier=no for bond/bridge/team devices.
* Add version mismatch warning when running nmcli commands.
@@ -296,7 +395,7 @@ Overview of changes since NetworkManager-1.38
* NetworkManager reads the kernel command line "/proc/cmdline" for several
purposes, including "nm.debug" for enabling debugging and the
"match.kernel-command-line" setting in the profile. NetworkManager now
first looks now for "/run/NetworkManager/proc-cmdline", which allows to
first looks now for "/run/NetworkManager/proc-cmdline", which allows one to
overwrite the command line.
* Improve the reapply of non-bridge properties.
* Honor adding a Bluetooth NAP connection with all available methods.
@@ -369,7 +468,7 @@ Overview of changes since NetworkManager-1.36
* Workaround libcurl blocking NetworkManager while resolving DNS names.
* nmcli: indicate missing Wi-Fi hardware when showing rfkill setting.
* nmcli: add connection migrate command to move a profile to a specified
settings plugin. This allows to convert profiles in the deprecated ifcfg-rh
settings plugin. This allows one to convert profiles in the deprecated ifcfg-rh
format to keyfile.
* Set "src" attribute for routes from DHCPv4 to the leased address. This
helps with source address selection.
@@ -501,7 +600,7 @@ and 1.32.12 are also present in NetworkManager-1.34:
* core: fix adding stale local routes when address changes.
* initrd: tag generated profiles with origin in user data.
* core: introduce "allowed-connections" option to disallow
profiles on a device. This allows to filter out profiles
profiles on a device. This allows one to filter out profiles
that originate from initrd.
* core: introduce "keep-configuration" device option to forcefully
activate a profile on start.
@@ -562,7 +661,7 @@ Overview of changes since NetworkManager-1.30
'nm-daemon-helper' binary is spawned to perform the lookup using
the 'dns' NSS module.
* dhcp: honor "ID_NET_DHCP_BROADCAST" udev attribute to set the broadcast flag.
This allows to configure devices in udev for which DHCPOFFER messages are to be
This allows one to configure devices in udev for which DHCPOFFER messages are to be
broadcast.
* firewall: add nftables firewall backend for configuring IPv4 NAT with shared
mode. Now two backends are supported, "iptables" and "nftables". The default
@@ -822,16 +921,16 @@ This is a new stable release of NetworkManager. Notable changes include:
in allowed-ips.
* Rework implementation of settings plugins and how profiles are presisted
to disk. This is a large internal refactoring of the settings plugins that
allows to migrate a connection profile between plugins.
allows one to migrate a connection profile between plugins.
* In-memory profiles are now only handled by keyfile plugin and will also be
persisted to /run directory. This allows to restart NetworkManager without
persisted to /run directory. This allows one to restart NetworkManager without
loosing these profiles and it provides a file-system based API for creating
in-memory profiles.
* Keyfile plugin now supports a read-only directory of profiles under directory
"/usr/lib/NetworkManager/system-connections". Such profiles still can be modified
and deleted via D-Bus, which results in writing profiles to /etc or /run that
shadow the read-only files.
* Add new D-Bus method AddConnection2() that allows to block autoconnect of
* Add new D-Bus method AddConnection2() that allows one to block autoconnect of
the profile at the moment when creating the profile. Also add support for
this API to libnm.
* Add flag "no-reapply" to Update2() D-Bus method. Normally, when a connection

View File

@@ -112,6 +112,14 @@ contrib/fedora/rpm/NetworkManager.conf for how to enable debug logging
in NetworkManager.
Requirements
------------
NetworkManager requires:
- Linux kernel >= 5.6 for some ethtool options (pause, eee, ring)
Documentation
-------------
@@ -133,7 +141,12 @@ Report bugs or feature request in our [issue tracker](https://gitlab.freedesktop
See [Report issues](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md?ref_type=heads#report-issues)
for details about how to do it.
To get involved, see [CONTRIBUTING.md](CONTRIBUTING.md)
Contribute
----------
To get involved, see [CONTRIBUTING.md](CONTRIBUTING.md) to find different ways
to contribute.
License

View File

@@ -1,31 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
set -e
srcdir=`dirname $0`
if test -z "$srcdir"; then
srcdir=.
fi
olddir=`pwd`
REQUIRED_AUTOMAKE_VERSION=1.9
PKG_NAME=NetworkManager
(test -f $srcdir/configure.ac \
&& test -f $srcdir/src/core/main.c) || {
printf "**Error**: Directory "\`$srcdir\'" does not look like the" >&2
echo " top-level $PKG_NAME directory" >&2
exit 1
}
cd $srcdir
gtkdocize
autoreconf --verbose --force --install
cd $olddir
if test -z "$NOCONFIGURE"; then
exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error --enable-gtk-doc --enable-introspection "$@"
fi

View File

@@ -1,27 +0,0 @@
# With autotools, it is not easily possible to generate these defines
# from configure.ac.
#
# See https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
#
# With meson-only, they could just be set via config.h.meson
config-extra.h: config-extra.h.mk config.h config.status
$(AM_V_GEN) \
echo "/* Generated by Makefile.am */" >$@ && \
echo "#define BINDIR \"$(bindir)\"" >>$@ && \
echo "#define DATADIR \"$(datadir)\"" >>$@ && \
echo "#define LIBEXECDIR \"$(libexecdir)\"" >>$@ && \
echo "#define LOCALSTATEDIR \"$(localstatedir)\"" >>$@ && \
echo "#define NMCONFDIR \"$(nmconfdir)\"" >>$@ && \
echo "#define NMLIBDIR \"$(nmlibdir)\"" >>$@ && \
echo "#define NMLOCALEDIR \"$(nmlocaledir)\"" >>$@ && \
echo "#define NMPLUGINDIR \"$(plugindir)\"" >>$@ && \
echo "#define NMRUNDIR \"$(nmrundir)\"" >>$@ && \
echo "#define NMSTATEDIR \"$(nmstatedir)\"" >>$@ && \
echo "#define NMVPNDIR \"$(pkglibdir)\"" >>$@ && \
echo "#define NM_BUILD_BUILDDIR \"$(abs_builddir)\"" >>$@ && \
echo "#define NM_BUILD_SRCDIR \"$(abs_srcdir)\"" >>$@ && \
echo "#define PPPD_PLUGIN_DIR \"$(PPPD_PLUGIN_DIR)\"" >>$@ && \
echo "#define PREFIX \"$(prefix)\"" >>$@ && \
echo "#define RUNSTATEDIR \"$(runstatedir)\"" >>$@ && \
echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@ && \
true

View File

@@ -4,9 +4,6 @@
/* Define to path of dhclient binary */
#mesondefine DHCLIENT_PATH
/* Define to path of dhcpcanon binary */
#mesondefine DHCPCANON_PATH
/* Define to path of dhcpcd binary */
#mesondefine DHCPCD_PATH
@@ -70,6 +67,9 @@
/* Define to path of iptables binary */
#mesondefine IPTABLES_PATH
/* Define to path of ip6tables binary */
#mesondefine IP6TABLES_PATH
/* Define to path of nft binary */
#mesondefine NFT_PATH
@@ -224,9 +224,6 @@
/* Define if you have dhclient */
#mesondefine WITH_DHCLIENT
/* Define if you have dhcpcanon */
#mesondefine WITH_DHCPCANON
/* Define if you have dhcpcd */
#mesondefine WITH_DHCPCD
@@ -283,3 +280,8 @@
/* Define to 1 if you have history support from -lreadline. */
#mesondefine HAVE_READLINE_HISTORY
/* Define if NBFT support is enabled */
#mesondefine WITH_NBFT
/* Define to 1 if dlvsym() is available */
#mesondefine HAVE_DLVSYM

File diff suppressed because it is too large Load Diff

View File

@@ -7,12 +7,10 @@ apk update
apk add \
'alpine-sdk' \
'autoconf' \
'automake' \
'bash' \
'clang' \
'curl-dev' \
'dbus' \
'dbus-glib-dev' \
'elogind-dev' \
'eudev-dev' \
'gcc' \
@@ -26,13 +24,13 @@ apk add \
'jansson-dev' \
'libgudev-dev' \
'libndp-dev' \
'libnvme-dev' \
'libnl3-dev' \
'libpsl-dev' \
'libsoup-dev' \
'libteam-dev' \
'libtool' \
'linux-headers' \
'make' \
'meson' \
'mobile-broadband-provider-info' \
'modemmanager-dev' \

View File

@@ -32,9 +32,6 @@ install_ignore_missing() {
install \
\
autoconf \
automake \
autopoint \
clang \
dbus \
dbus-x11 \
@@ -59,6 +56,7 @@ install \
libndp-dev \
libnewt-dev \
libnss3-dev \
libnvme-dev \
libpolkit-gobject-1-dev \
libpsl-dev \
libreadline-dev \
@@ -67,11 +65,9 @@ install \
libtool \
libudev-dev \
locales \
make \
meson \
mobile-broadband-provider-info \
pkg-config \
policykit-1 \
ppp \
ppp-dev \
python3-dbus \
@@ -87,6 +83,8 @@ install \
install_ignore_missing \
python-setuptools \
policykit-1 \
polkitd \
\
#end

View File

@@ -52,7 +52,7 @@ install \
clang \
dbus-devel \
dbus-x11 \
dhclient \
ethtool \
firewalld-filesystem \
gcc-c++ \
gettext-devel \
@@ -66,10 +66,10 @@ install \
jq \
libcurl-devel \
libndp-devel \
libnvme-devel \
libselinux-devel \
libtool \
libuuid-devel \
make \
meson \
mobile-broadband-provider-info-devel \
newt-devel \
@@ -83,26 +83,22 @@ install \
readline-devel \
rpm-build \
systemd-devel \
teamd-devel \
util-linux \
vala \
valgrind \
which \
"${EXTRA_PACKAGES[@]}"
#end
# some packages don't exist in certain distributions. Install them one-by-one, and ignore errors.
install_ignore_missing \
black \
dbus-python \
dhclient \
iproute-tc \
libasan \
libpsl-devel \
libubsan \
libvala-devel \
pexpect \
pygobject3-base \
python-gobject-base \
python36-pexpect \
qt-devel \
teamd-devel \
vala-devel \
#end
"${EXTRA_PACKAGES[@]}"

View File

@@ -23,7 +23,7 @@
#
# See `man 5 nm-settings` for "wifi.cloned-mac-address" and "connection.stable-id".
[connection.22-wifi-mac-addr]
[connection-22-wifi-mac-addr]
match-device=type:wifi
wifi.cloned-mac-address=stable-ssid

View File

@@ -1,5 +1,5 @@
# SPEC file to build NetworkManager for testing. It aims for a similar
# configuration as rhel-7.0 and Fedora rawhide
# configuration as RHEL and Fedora Rawhide
#
# This spec file is not used as is to create official packages for RHEL, Fedora or any
# other distribution.
@@ -14,6 +14,7 @@
%global epoch_version 1
%global real_version __VERSION__
%global git_tag_version __GIT_TAG_VERSION__
%global rpm_version %{real_version}
%global release_version __RELEASE_VERSION__
%global snapshot __SNAPSHOT__
@@ -49,9 +50,9 @@
###############################################################################
%if 0%{?fedora} > 40 || 0%{?rhel} >= 10
%bcond_without meson
%bcond_with dhclient
%else
%bcond_with meson
%bcond_without dhclient
%endif
%bcond_without adsl
%bcond_without bluetooth
@@ -78,7 +79,7 @@
%bcond_with test
%endif
%if "%{?bcond_default_lto}" == ""
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%if 0%{?fedora} || 0%{?rhel} >= 9
%bcond_without lto
%else
%bcond_with lto
@@ -96,44 +97,21 @@
%else
%bcond_with connectivity_fedora
%endif
%if 0%{?rhel} && 0%{?rhel} >= 8
%if 0%{?rhel}
%bcond_without connectivity_redhat
%else
%bcond_with connectivity_redhat
%endif
%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
%bcond_without crypto_gnutls
%else
%bcond_with crypto_gnutls
%endif
%if 0%{?rhel}
%bcond_with iwd
%else
%bcond_without iwd
%endif
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 8
%bcond_without firewalld_zone
%else
%bcond_with firewalld_zone
%endif
###############################################################################
%if 0%{?fedora} || 0%{?rhel} >= 8
%global dbus_version 1.9.18
%global dbus_sys_dir %{_datadir}/dbus-1/system.d
%else
%global dbus_version 1.1
%global dbus_sys_dir %{_sysconfdir}/dbus-1/system.d
%endif
# Older libndp versions use select() (rh#1933041). On well known distros,
# choose a version that has the necessary fix.
%if 0%{?rhel} && 0%{?rhel} == 8
%global libndp_version 1.7-4
%else
%global libndp_version %{nil}
%endif
%if %{with bluetooth} || %{with wwan}
%global with_modem_manager_1 1
@@ -141,51 +119,39 @@
%global with_modem_manager_1 0
%endif
%if 0%{?fedora} >= 31 || 0%{?rhel} >= 8
%global dhcp_default internal
%else
%global dhcp_default dhclient
%endif
%if 0%{?fedora} || 0%{?rhel} >= 8
%global logging_backend_default journal
%if 0%{?fedora} || 0%{?rhel} >= 9
%global dns_rc_manager_default auto
%else
%global dns_rc_manager_default symlink
%endif
%else
%global logging_backend_default syslog
%global dns_rc_manager_default file
%endif
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
%global config_plugins_default_ifcfg_rh 0
%bcond_with default_ifcfg_rh
%else
%global config_plugins_default_ifcfg_rh 1
%bcond_without default_ifcfg_rh
%endif
%if 0%{?rhel} >= 10
%global with_ifcfg_rh 0
%global split_ifcfg_rh 0
%if 0%{?rhel} >= 10 || 0%{?fedora} >= 41
%bcond_with ifcfg_rh
%bcond_with split_ifcfg_rh
%elif 0%{?fedora} >= 36
%global with_ifcfg_rh 1
%global split_ifcfg_rh 1
%bcond_without ifcfg_rh
%bcond_without split_ifcfg_rh
%else
%global with_ifcfg_rh 1
%global split_ifcfg_rh 0
%bcond_without ifcfg_rh
%bcond_with split_ifcfg_rh
%endif
%if (0%{?fedora} >= 36 && 0%{?fedora} < 39) || 0%{?rhel} == 9
%global ifcfg_warning 1
%bcond_without ifcfg_warning
%else
%global ifcfg_warning 0
%bcond_with ifcfg_warning
%endif
%if 0%{?fedora} >= 39
%global ifcfg_migrate 1
%if %{with ifcfg_rh} && 0%{?fedora} >= 39
%bcond_without ifcfg_migrate
%else
%global ifcfg_migrate 0
%bcond_with ifcfg_migrate
%endif
%if 0%{?fedora}
@@ -215,7 +181,7 @@ Group: System Environment/Base
License: GPL-2.0-or-later AND LGPL-2.1-or-later
URL: https://networkmanager.dev/
#Source: https://download.gnome.org/sources/NetworkManager/%{real_version_major}/%{name}-%{real_version}.tar.xz
#Source: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/releases/%{git_tag_version}/downloads/%{name}-%{real_version}.tar.xz
Source: __SOURCE1__
Source1: NetworkManager.conf
Source2: 00-server.conf
@@ -229,9 +195,7 @@ Source9: readme-ifcfg-rh-migrated.txt
#Patch1: 0001-some.patch
Requires(post): systemd
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires(post): systemd-udev
%endif
Requires(post): /usr/sbin/update-alternatives
Requires(preun): systemd
Requires(preun): /usr/sbin/update-alternatives
@@ -240,26 +204,27 @@ Requires(postun): systemd
Requires: dbus >= %{dbus_version}
Requires: glib2 >= %{glib2_version}
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
%if "%{libndp_version}" != ""
Requires: libndp >= %{libndp_version}
Recommends: iputils
%if 0%{?rhel} == 8
# Older libndp versions use select() (rh#1933041). On well known distros,
# choose a version that has the necessary fix.
Requires: libndp >= 1.7-4
%endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
Obsoletes: NetworkManager < %{obsoletes_ppp_plugin}
Obsoletes: NetworkManager-wimax < 1:1.2
%if 0%{?rhel} && 0%{?rhel} == 8
%if 0%{?rhel} == 8
Suggests: NetworkManager-initscripts-updown
%endif
Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
%if 0%{?split_ifcfg_rh}
%if %{with split_ifcfg_rh}
Obsoletes: NetworkManager < %{obsoletes_ifcfg_rh}
%endif
%if 0%{?rhel} && 0%{?rhel} <= 7
# Kept for RHEL to ensure that wired 802.1x works out of the box
Requires: wpa_supplicant >= 1:1.1
%endif
%if 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{?rhel} >= 10
%if 0%{without team}
Obsoletes: NetworkManager-team < 1:1.47.5-3
%endif
@@ -267,12 +232,20 @@ Obsoletes: NetworkManager-initscripts-ifcfg-rh < 1:1.47.5-3
Obsoletes: NetworkManager-dispatcher-routing-rules < 1:1.47.5-3
%endif
%if 0%{?fedora} >= 41
%if %{without ifcfg_rh}
Obsoletes: NetworkManager-initscripts-ifcfg-rh < 1:1.49-3.1
Obsoletes: NetworkManager-dispatcher-routing-rules < 1:1.49.3-1
Obsoletes: NetworkManager-initscripts-updown < 1:1.49.3-1
%endif
%endif
Conflicts: NetworkManager-vpnc < 1:0.7.0.99-1
Conflicts: NetworkManager-openvpn < 1:0.7.0.99-1
Conflicts: NetworkManager-pptp < 1:0.7.0.99-1
Conflicts: NetworkManager-openconnect < 0:0.7.0.99-1
Conflicts: kde-plasma-networkmanagement < 1:0.9-0.49.20110527git.nm09
%if 0%{?rhel} && 0%{?rhel} >= 10
%if 0%{?rhel} >= 10
%if 0%{without team}
Conflicts: NetworkManager-team <= 1:1.47.5-3
%endif
@@ -280,16 +253,10 @@ Conflicts: NetworkManager-initscripts-ifcfg-rh <= 1:1.47.5-3
Conflicts: NetworkManager-dispatcher-routing-rules <= 1:1.47.5-3
%endif
BuildRequires: make
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: pkgconfig
%if %{with meson}
BuildRequires: meson
%else
BuildRequires: automake
BuildRequires: autoconf
%endif
BuildRequires: gettext-devel >= 0.19.8
BuildRequires: dbus-devel >= %{dbus_version}
@@ -298,11 +265,7 @@ BuildRequires: gobject-introspection-devel >= 0.10.3
%if %{with ppp}
BuildRequires: ppp-devel >= 2.4.5
%endif
%if %{with crypto_gnutls}
BuildRequires: gnutls-devel >= 2.12
%else
BuildRequires: nss-devel >= 3.11.7
%endif
BuildRequires: readline-devel
BuildRequires: audit-libs-devel
%if %{with regen_docs}
@@ -340,17 +303,12 @@ BuildRequires: polkit-devel
BuildRequires: jansson-devel
%if %{with sanitizer}
BuildRequires: libasan
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: libubsan
%endif
%endif
%if %{with firewalld_zone}
BuildRequires: firewalld-filesystem
%endif
BuildRequires: iproute
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: iproute-tc
%endif
BuildRequires: libnvme-devel >= 1.5
Provides: %{name}-dispatcher%{?_isa} = %{epoch}:%{version}-%{release}
@@ -393,12 +351,7 @@ Summary: Bluetooth device plugin for NetworkManager
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: NetworkManager-wwan = %{epoch}:%{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} <= 7
# No Requires:bluez to prevent it being installed when updating
# to the split NM package
%else
Requires: bluez >= 4.101-5
%endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%description bluetooth
@@ -413,12 +366,10 @@ Group: System Environment/Base
BuildRequires: teamd-devel
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%if 0%{?fedora} || 0%{?rhel} >= 8
# Team was split from main NM binary between 0.9.10 and 1.0
# We need this Obsoletes in addition to the one above
# (git:3aede801521ef7bff039e6e3f1b3c7b566b4338d).
Obsoletes: NetworkManager < 1:1.0.0
%endif
%description team
This package contains NetworkManager support for team devices.
@@ -437,13 +388,10 @@ Requires: wireless-regdb
Requires: crda
%endif
%if %{with iwd} && (0%{?fedora} >= 25 || 0%{?rhel} >= 8)
%if %{with iwd}
Requires: (wpa_supplicant >= %{wpa_supplicant_version} or iwd)
Suggests: wpa_supplicant
%else
# Just require wpa_supplicant on platforms that don't support boolean
# dependencies even though the plugin supports both supplicant and
# iwd backend.
Requires: wpa_supplicant >= %{wpa_supplicant_version}
%endif
@@ -459,12 +407,7 @@ This package contains NetworkManager support for Wifi and OLPC devices.
Summary: Mobile broadband device plugin for NetworkManager
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} <= 7
# No Requires:ModemManager to prevent it being installed when updating
# to the split NM package
%else
Requires: ModemManager
%endif
Obsoletes: NetworkManager < %{obsoletes_device_plugins}
%description wwan
@@ -567,13 +510,14 @@ This package is intended to be installed by default for server
deployments.
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%package dispatcher-routing-rules
Summary: NetworkManager dispatcher file for advanced routing rules
Group: System Environment/Base
%if 0%{?split_ifcfg_rh}
%if %{with split_ifcfg_rh}
Requires: %{name}-initscripts-ifcfg-rh
%endif
Requires: ipcalc
BuildArch: noarch
Provides: %{name}-config-routing-rules = %{epoch}:%{version}-%{release}
Obsoletes: %{name}-config-routing-rules < 1:1.31.0
@@ -599,7 +543,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%endif
%if 0%{?split_ifcfg_rh}
%if %{with split_ifcfg_rh}
%package initscripts-ifcfg-rh
Summary: NetworkManager plugin for reading and writing connections in ifcfg-rh format
Group: System Environment/Base
@@ -626,7 +570,7 @@ like Aliyun, Azure, EC2, GCP are supported.
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%package initscripts-updown
Summary: Legacy ifup/ifdown scripts for NetworkManager that replace initscripts (network-scripts)
Group: System Environment/Base
@@ -641,12 +585,12 @@ This is only for backward compatibility with initscripts (network-scripts).
Preferably use nmcli instead.
%endif
%prep
%autosetup -p1 -n NetworkManager-%{real_version}
%build
%if %{with meson}
%meson \
-Db_ndebug=false \
--warnlevel 2 \
@@ -655,15 +599,14 @@ Preferably use nmcli instead.
%endif
-Dnft=%{_sbindir}/nft \
-Diptables=%{_sbindir}/iptables \
-Dip6tables=%{_sbindir}/ip6tables \
%if %{with dhclient}
-Ddhclient=%{_sbindir}/dhclient \
-Ddhcpcanon=no \
-Ddhcpcd=no \
-Dconfig_dhcp_default=%{dhcp_default} \
%if %{with crypto_gnutls}
-Dcrypto=gnutls \
%else
-Dcrypto=nss \
-Ddhclient=no \
%endif
-Ddhcpcd=no \
-Dcrypto=gnutls \
%if %{with debug}
-Dmore_logging=true \
-Dmore_asserts=10000 \
@@ -753,7 +696,7 @@ Preferably use nmcli instead.
-Ddbus_conf_dir=%{dbus_sys_dir} \
-Dtests=yes \
-Dvalgrind=no \
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
-Difcfg_rh=true \
%else
-Difcfg_rh=false \
@@ -765,187 +708,23 @@ Preferably use nmcli instead.
-Dpppd_plugin_dir="%{_libdir}/pppd/%{ppp_version}" \
%else
-Dppp=false \
%endif
%if %{with firewalld_zone}
-Dfirewalld_zone=true \
%else
-Dfirewalld_zone=false \
%endif
-Ddist_version=%{version}-%{release} \
%if %{?config_plugins_default_ifcfg_rh}
%if %{with default_ifcfg_rh}
-Dconfig_plugins_default=ifcfg-rh \
%endif
%if %{?ifcfg_migrate}
%if %{with ifcfg_migrate}
-Dconfig_migrate_ifcfg_rh_default=true \
%endif
-Dresolvconf=no \
-Dnetconfig=no \
-Dconfig_dns_rc_manager_default=%{dns_rc_manager_default} \
-Dconfig_logging_backend_default=%{logging_backend_default}
-Dconfig_logging_backend_default=journal
%meson_build
%else
# autotools
%if %{with regen_docs}
gtkdocize
%endif
autoreconf --install --force
%configure \
--with-runstatedir=%{_rundir} \
--enable-silent-rules=no \
--enable-static=no \
--with-nft=%{_sbindir}/nft \
--with-iptables=%{_sbindir}/iptables \
--with-dhclient=%{_sbindir}/dhclient \
--with-dhcpcd=no \
--with-dhcpcanon=no \
--with-config-dhcp-default=%{dhcp_default} \
%if %{with crypto_gnutls}
--with-crypto=gnutls \
%else
--with-crypto=nss \
%endif
%if %{with sanitizer}
--with-address-sanitizer=exec \
%if 0%{?fedora} || 0%{?rhel} >= 8
--enable-undefined-sanitizer=yes \
%else
--enable-undefined-sanitizer=no \
%endif
%else
--with-address-sanitizer=no \
--enable-undefined-sanitizer=no \
%endif
%if %{with debug}
--enable-more-logging=yes \
--with-more-asserts=10000 \
%else
--enable-more-logging=no \
--with-more-asserts=0 \
%endif
--enable-ld-gc=yes \
%if %{with lto}
--enable-lto=yes \
%else
--enable-lto=no \
%endif
--with-libaudit=yes-disabled-by-default \
%if 0%{?with_modem_manager_1}
--with-modem-manager-1=yes \
%else
--with-modem-manager-1=no \
%endif
%if %{with wifi}
--enable-wifi=yes \
%if 0%{?fedora}
--with-wext=yes \
%else
--with-wext=no \
%endif
%else
--enable-wifi=no \
%endif
%if %{with iwd}
--with-iwd=yes \
%else
--with-iwd=no \
%endif
%if %{with bluetooth}
--enable-bluez5-dun=yes \
%else
--enable-bluez5-dun=no \
%endif
%if %{with nmtui}
--with-nmtui=yes \
%else
--with-nmtui=no \
%endif
%if %{with nm_cloud_setup}
--with-nm-cloud-setup=yes \
%else
--with-nm-cloud-setup=no \
%endif
--enable-vala=yes \
--enable-introspection=yes \
%if %{with regen_docs}
--enable-gtk-doc=yes \
%else
--enable-gtk-doc=no \
%endif
%if %{with team}
--enable-teamdctl=yes \
%else
--enable-teamdctl=no \
%endif
%if %{with ovs}
--enable-ovs=yes \
%else
--enable-ovs=no \
%endif
--with-selinux=yes \
--enable-polkit=yes \
--enable-modify-system=yes \
--enable-concheck=yes \
%if 0%{?fedora}
--with-libpsl=yes \
%else
--with-libpsl=no \
%endif
--with-ebpf=%{ebpf_enabled} \
--with-session-tracking=systemd \
--with-suspend-resume=systemd \
--with-systemdsystemunitdir=%{_unitdir} \
--with-system-ca-path=/etc/pki/tls/cert.pem \
--with-dbus-sys-dir=%{dbus_sys_dir} \
--with-tests=yes \
%if %{with test}
--enable-more-warnings=error \
%else
--enable-more-warnings=yes \
%endif
--with-valgrind=no \
%if %{?with_ifcfg_rh}
--enable-ifcfg-rh=yes \
%else
--enable-ifcfg-rh=no \
%endif
--enable-ifupdown=no \
%if %{with ppp}
--enable-ppp=yes \
--with-pppd="%{_sbindir}/pppd" \
--with-pppd-plugin-dir="%{_libdir}/pppd/%{ppp_version}" \
%else
--enable-ppp=no \
%endif
%if %{with firewalld_zone}
--enable-firewalld-zone=yes \
%else
--enable-firewalld-zone=no \
%endif
--with-dist-version=%{version}-%{release} \
%if %{?config_plugins_default_ifcfg_rh}
--with-config-plugins-default=ifcfg-rh \
%endif
%if %{?ifcfg_migrate}
--with-config-migrate-ifcfg-rh-default=yes \
%endif
--with-resolvconf=no \
--with-netconfig=no \
--with-config-dns-rc-manager-default=%{dns_rc_manager_default} \
--with-config-logging-backend-default=%{logging_backend_default} \
--disable-autotools-deprecation
%make_build
%endif
%install
%if %{with meson}
%meson_install
%else
%make_install
%endif
cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/
@@ -965,14 +744,14 @@ cp %{SOURCE7} %{buildroot}%{_sysctldir}
cp %{SOURCE6} %{buildroot}%{nmlibdir}/conf.d/
%endif
%if 0%{?ifcfg_warning}
%if %{with ifcfg_warning}
cp %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts
%endif
%if 0%{?ifcfg_migrate}
%if %{with ifcfg_migrate}
cp %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/
ln -s ../no-wait.d/10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/pre-up.d/
ln -s ../10-ifcfg-rh-routes.sh %{buildroot}%{nmlibdir}/dispatcher.d/no-wait.d/
@@ -984,35 +763,31 @@ rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/pppd/%{ppp_version}/*.la
rm -f %{buildroot}%{nmplugindir}/*.la
# Don't use the *-initrd.service files yet, wait dracut to support them
rm -f %{buildroot}%{_unitdir}/NetworkManager-config-initrd.service
rm -f %{buildroot}%{_unitdir}/NetworkManager-initrd.service
rm -f %{buildroot}%{_unitdir}/NetworkManager-wait-online-initrd.service
# Ensure the documentation timestamps are constant to avoid multilib conflicts
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference configure.ac '{}' \+
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference meson.build '{}' \+
%if 0%{?__debug_package} && ! 0%{?flatpak}
mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
touch %{buildroot}%{_sbindir}/ifup
touch %{buildroot}%{_sbindir}/ifdown
%endif
%check
%if %{with meson}
%if %{with test}
%meson_test
%else
%ninja_test -C %{_vpath_builddir} || :
%endif
%else
# autotools
%if %{with test}
make -k %{?_smp_mflags} check
%else
make -k %{?_smp_mflags} check || :
%endif
%endif
%pre
if [ -f "%{_unitdir}/network-online.target.wants/NetworkManager-wait-online.service" ] ; then
@@ -1031,14 +806,12 @@ if [ -S /run/udev/control ]; then
/usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || :
fi
%if %{with firewalld_zone}
%firewalld_reload
%endif
%systemd_post %{systemd_units}
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%post initscripts-updown
if [ -f %{_sbindir}/ifup -a ! -L %{_sbindir}/ifup ]; then
# initscripts package too old, won't let us set an alternative
@@ -1067,7 +840,7 @@ fi
%systemd_preun NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%preun initscripts-updown
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove ifup %{_libexecdir}/nm-ifup >/dev/null 2>&1 || :
@@ -1084,19 +857,11 @@ fi
%postun
/usr/bin/udevadm control --reload-rules || :
/usr/bin/udevadm trigger --subsystem-match=net || :
%if %{with firewalld_zone}
%firewalld_reload
%endif
%systemd_postun %{systemd_units}
%if (0%{?fedora} && 0%{?fedora} < 28) || 0%{?rhel}
%post libnm -p /sbin/ldconfig
%postun libnm -p /sbin/ldconfig
%endif
%if %{with nm_cloud_setup}
%postun cloud-setup
%systemd_postun %{systemd_units_cloud_setup}
@@ -1107,7 +872,7 @@ fi
%{dbus_sys_dir}/org.freedesktop.NetworkManager.conf
%{dbus_sys_dir}/nm-dispatcher.conf
%{dbus_sys_dir}/nm-priv-helper.conf
%if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%if %{with ifcfg_rh} && %{without split_ifcfg_rh}
%{dbus_sys_dir}/nm-ifcfg-rh.conf
%endif
%{_sbindir}/%{name}
@@ -1135,7 +900,7 @@ fi
%{_libexecdir}/nm-priv-helper
%dir %{_libdir}/%{name}
%dir %{nmplugindir}
%if %{?with_ifcfg_rh} && 0%{?split_ifcfg_rh} == 0
%if %{with ifcfg_rh} && %{without split_ifcfg_rh}
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%endif
%if %{with nmtui}
@@ -1157,16 +922,14 @@ fi
%{_mandir}/man8/NetworkManager-dispatcher.8*
%{_mandir}/man8/NetworkManager-wait-online.service.8*
%dir %{_localstatedir}/lib/NetworkManager
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%dir %{_sysconfdir}/sysconfig/network-scripts
%endif
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service
%{_datadir}/polkit-1/actions/*.policy
%{_prefix}/lib/udev/rules.d/*.rules
%if %{with firewalld_zone}
%{_prefix}/lib/firewalld/zones/nm-shared.xml
%endif
# systemd stuff
%{_unitdir}/NetworkManager.service
%{_unitdir}/NetworkManager-wait-online.service
@@ -1174,7 +937,7 @@ fi
%{_unitdir}/nm-priv-helper.service
%dir %{_datadir}/doc/NetworkManager/examples
%{_datadir}/doc/NetworkManager/examples/server.conf
%if 0%{?ifcfg_warning} || 0%{?ifcfg_migrate}
%if %{with ifcfg_warning} || %{with ifcfg_migrate}
%{_sysconfdir}/sysconfig/network-scripts/readme-ifcfg-rh.txt
%endif
%doc NEWS AUTHORS README.md CONTRIBUTING.md
@@ -1274,13 +1037,14 @@ fi
%{nmlibdir}/conf.d/00-server.conf
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%files dispatcher-routing-rules
%{nmlibdir}/dispatcher.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/no-wait.d/10-ifcfg-rh-routes.sh
%{nmlibdir}/dispatcher.d/pre-up.d/10-ifcfg-rh-routes.sh
%endif
%if %{with nmtui}
%files tui
%{_bindir}/nmtui
@@ -1291,7 +1055,7 @@ fi
%endif
%if 0%{?split_ifcfg_rh}
%if %{with split_ifcfg_rh}
%files initscripts-ifcfg-rh
%{nmplugindir}/libnm-settings-plugin-ifcfg-rh.so
%{dbus_sys_dir}/nm-ifcfg-rh.conf
@@ -1310,7 +1074,7 @@ fi
%endif
%if %{?with_ifcfg_rh}
%if %{with ifcfg_rh}
%files initscripts-updown
%{_libexecdir}/nm-ifup
%ghost %attr(755, root, root) %{_sbindir}/ifup

View File

@@ -1,6 +1,8 @@
#!/bin/bash
#set -vx
set -e
set -o pipefail
# Set arguments via environment variables.
# Argument can be omitted and defaults will be detected.
@@ -10,6 +12,7 @@
# RELEASE_VERSION=
# SNAPSHOT=
# VERSION=
# GIT_TAG_VERSION=
# COMMIT_FULL=
# COMMIT=
# USERNAME=
@@ -76,14 +79,7 @@ abs_path() {
}
get_version() {
local major minor micro
local F="${1:-"$GITDIR/configure.ac"}"
vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
eval "$vars"
[[ -n "$major" && -n "$minor" && "$micro" ]] || return 1
echo "$major.$minor.$micro"
grep -E -m1 '^\s+version:' "$GITDIR/meson.build" | cut -d"'" -f2
}
write_changelog() {
@@ -117,12 +113,13 @@ UUID=`uuidgen`
RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list HEAD | wc -l)}"
SNAPSHOT="${SNAPSHOT:-%{nil\}}"
VERSION="${VERSION:-$(get_version || die "Could not read $VERSION")}"
GIT_TAG_VERSION="${GIT_TAG_VERSION:-$VERSION}"
COMMIT_FULL="${COMMIT_FULL:-$(git rev-parse --verify HEAD || die "Error reading HEAD revision")}"
COMMIT="${COMMIT:-$(printf '%s' "$COMMIT_FULL" | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}"
BCOND_DEFAULT_DEBUG="${BCOND_DEFAULT_DEBUG:-0}"
BCOND_DEFAULT_TEST="${BCOND_DEFAULT_TEST:-0}"
BCOND_DEFAULT_LTO="${BCOND_DEFAULT_LTO}"
USERNAME="${USERNAME:-"$(git config user.name) <$(git config user.email)>"}"
USERNAME="${USERNAME:-"$(git config user.name || :) <$(git config user.email || :)>"}"
SPECFILE="$(abs_path "$SPECFILE" "$SCRIPTDIR/NetworkManager.spec")" || die "invalid \$SPECFILE argument"
SOURCE_FROM_GIT="$(coerce_bool "$SOURCE_FROM_GIT" "")"
SOURCE="$(abs_path "$SOURCE")" || die "invalid \$SOURCE argument"
@@ -132,7 +129,7 @@ if [ -n "$SOURCE" ]; then
[[ "$SOURCE_FROM_GIT" == 1 ]] && die "Cannot set both \$SOURCE and \$SOURCE_FROM_GIT=1"
SOURCE_FROM_GIT=0
elif [[ "$SOURCE_FROM_GIT" != "1" ]]; then
SOURCE="$(ls -1 "$GITDIR/NetworkManager-${VERSION}.tar."* 2>/dev/null | head -n1)"
SOURCE="$(ls -1 "$GITDIR/NetworkManager-${VERSION}.tar."* 2>/dev/null | head -n1 || :)"
if [[ -z "$SOURCE" ]]; then
[[ "$SOURCE_FROM_GIT" == "0" ]] && die "Either set \$SOURCE or set \$SOURCE_FROM_GIT=1"
SOURCE_FROM_GIT=1
@@ -160,6 +157,7 @@ if [[ "$SOURCE_FROM_GIT" == "1" ]]; then
fi
LOG "VERSION=$VERSION"
LOG "GIT_TAG_VERSION=$GIT_TAG_VERSION"
LOG "RELEASE_VERSION=$RELEASE_VERSION"
LOG "SNAPSHOT=$SNAPSHOT"
LOG "COMMIT_FULL=$COMMIT_FULL"
@@ -212,6 +210,7 @@ cp "$SOURCE_README_IFCFG_MIGRATED" "$TEMP/SOURCES/readme-ifcfg-rh-migrated.txt"
write_changelog
sed -e "s/__VERSION__/$VERSION/g" \
-e "s/__GIT_TAG_VERSION__/$GIT_TAG_VERSION/g" \
-e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \
-e "s/__SNAPSHOT__/$SNAPSHOT/g" \
-e "s/__COMMIT__/$COMMIT/g" \
@@ -242,7 +241,7 @@ rpmbuild --define "_topdir $TEMP" $RPM_BUILD_OPTION "$TEMPSPEC" $NM_RPMBUILD_ARG
LS_EXTRA=()
if [ "$SIGN_SOURCE" = 1 ]; then
SIGNKEY="$(git config --get user.signingkey)"
SIGNKEY="$(git config --get user.signingkey || :)"
if [ "$SIGNKEY" != "" ]; then
SIGNKEY="--local-user $(printf '%q' "$SIGNKEY")"
fi
@@ -269,7 +268,7 @@ ls -dla \
"$TEMP_LATEST"/RPMS/*/*.rpm \
"$TEMP_LATEST"/SRPMS/ \
"$TEMP_LATEST"/SRPMS/*.rpm \
2>/dev/null | sed 's/^/ /'
2>/dev/null | sed 's/^/ /' || :
LOG
if [[ "$BUILDTYPE" == "SRPM" ]]; then
LOG sudo $(command -v dnf &>/dev/null && echo dnf builddep || echo yum-builddep) $TEMP_LATEST/SRPMS/*.src.rpm

View File

@@ -1,5 +1,7 @@
#!/bin/bash
set -e
set -o pipefail
die() {
echo "$*" >&2
@@ -18,11 +20,9 @@ usage() {
echo " -f|--force: force build, even if working directory is not clean and has local modifications"
echo " -c|--clean: run \`git-clean -fdx :/\` before build"
echo " -S|--srpm: only build the SRPM"
echo " -g|--git: create tarball from current git HEAD (skips make dist)"
echo " -g|--git: create tarball from current git HEAD (skips meson dist)"
echo " -Q|--quick: only create the distribution tarball, without running checks"
echo " -N|--no-dist: skip creating the source tarball if you already did \`make dist\`"
echo " -m|--meson: (default) use meson to create the source tarball"
echo " -A|--autotools: use autotools to create the source tarball"
echo " -N|--no-dist: skip creating the source tarball if you already did \`meson dist\`"
echo " -w|--with \$OPTION: pass --with \$OPTION to rpmbuild. For example --with debug"
echo " -W|--without \$OPTION: pass --without \$OPTION to rpmbuild. For example --without debug"
echo " -s|--snapshot TEXT: use TEXT as the snapshot version for the new package (overwrites \$NM_BUILD_SNAPSHOT environment)"
@@ -99,14 +99,6 @@ while [[ $# -gt 0 ]]; do
IGNORE_DIRTY=1
SOURCE_FROM_GIT=1
;;
-m|--meson)
[ "$USE_AUTOTOOLS" = 1 ] && die "conflicting argument: $A when building with autotools is requested";
USE_MESON=1
;;
-A|--autotools)
[ "$USE_MESON" = 1 ] && die "conflicting argument: $A when building with meson is explicitly requested";
USE_AUTOTOOLS=1
;;
-Q|--quick)
QUICK=1
;;
@@ -151,7 +143,7 @@ while [[ $# -gt 0 ]]; do
;;
--no-auto-with-test)
# by default, the script adds "-w test" (unless the command line contains
# "-w test" or "-W test"). This flags allows to suppress that automatism.
# "-w test" or "-W test"). This flag suppresses that automatism.
# It's really only useful to test the spec file's internal default for the
# "test" option. Otherwise, you can always just explicitly select "-w test"
# or "-W test".
@@ -199,98 +191,54 @@ if [[ $IGNORE_DIRTY != 1 ]]; then
fi
get_version_meson() {
meson introspect "$GITDIR/build" --projectinfo | jq -r .version
meson introspect "$GITDIR/build" --projectinfo |
python -c 'import json, sys; print(json.load(sys.stdin)["version"])'
}
if [[ $NO_DIST != 1 ]]; then
if [[ $USE_AUTOTOOLS != 1 ]]; then
meson setup "$GITDIR/build" \
--prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
-Ddocs=true \
-Dintrospection=true \
-Difcfg_rh=true \
-Difupdown=true \
-Dconfig_logging_backend_default=syslog \
-Dconfig_wifi_backend_default=wpa_supplicant \
-Dlibaudit=yes-disabled-by-default \
-Dpolkit=true \
-Dnm_cloud_setup=true \
-Dconfig_dhcp_default=internal \
-Dconfig_dns_rc_manager_default=auto \
-Diptables=/usr/sbin/iptables \
-Dnft=/usr/bin/nft \
|| die "Error meson setup"
meson setup "$GITDIR/build" \
--prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
-Ddocs=true \
-Dintrospection=true \
-Difcfg_rh=true \
-Difupdown=true \
-Dconfig_logging_backend_default=syslog \
-Dconfig_wifi_backend_default=wpa_supplicant \
-Dlibaudit=yes-disabled-by-default \
-Dpolkit=true \
-Dnm_cloud_setup=true \
-Ddhclient=/usr/sbin/dhclient \
-Dconfig_dhcp_default=internal \
-Dconfig_dns_rc_manager_default=auto \
-Diptables=/usr/sbin/iptables \
-Dip6tables=/usr/sbin/ip6tables \
-Dnft=/usr/bin/nft \
|| die "Error meson setup"
VERSION="${VERSION:-$(get_version_meson || die "Could not read $VERSION")}"
if [[ $QUICK == 1 ]]; then
meson dist --allow-dirty -C "$GITDIR/build/" --no-tests || die "Error meson dist"
else
meson dist --allow-dirty -C "$GITDIR/build/" || die "Error meson dist with tests"
fi
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
else
./autogen.sh \
--with-runstatedir=/run \
--program-prefix= \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
\
--disable-dependency-tracking \
--enable-gtk-doc \
--enable-introspection \
--enable-ifcfg-rh \
--enable-ifupdown \
--with-config-logging-backend-default=syslog \
--with-config-wifi-backend-default=wpa_supplicant \
--with-libaudit=yes-disabled-by-default \
--enable-polkit=yes \
--with-nm-cloud-setup=yes \
--with-config-dhcp-default=internal \
--with-config-dns-rc-manager-default=auto \
\
--with-iptables=/usr/sbin/iptables \
--with-nft=/usr/sbin/nft \
--disable-autotools-deprecation \
\
|| die "Error autogen.sh"
if [[ $QUICK == 1 ]]; then
make dist -j 7 || die "Error make dist"
else
make distcheck -j 7 || die "Error make distcheck"
fi
VERSION="${VERSION:-$(get_version_meson || die "Could not read VERSION")}"
TEST_FLAG=""
if [[ $QUICK == 1 ]]; then
TEST_FLAG="--no-tests"
fi
meson dist --allow-dirty -C "$GITDIR/build/" $TEST_FLAG || die "Error meson dist"
export SOURCE="$(ls -1 "$GITDIR/build/meson-dist/NetworkManager-${VERSION}.tar.xz" 2>/dev/null | head -n1)"
fi
if [[ "$ADD_WITH_TEST" == 1 ]]; then
WITH_LIST=("${WITH_LIST[@]}" "--with" "test")
fi
if [[ "$USE_AUTOTOOLS" != 1 ]]; then
WITH_LIST=("${WITH_LIST[@]}" "--with" "meson")
fi
export SOURCE_FROM_GIT
export BUILDTYPE
export NM_RPMBUILD_ARGS="${WITH_LIST[@]}"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# Run configure/meson for NetworkManager in a way similar to how an RPM build does it.
# The effect is, that if you do `make install`, that it will overwrite the files that
# The effect is, that if you do `meson install`, that it will overwrite the files that
# you'd usually get by installing the NetworkManager RPM. Also, it means you can afterwards
# systemctl restart NetworkManager.
@@ -30,10 +30,10 @@ vars_with_vals() {
}
usage() {
echo "$ $0 [-m|--meson <builddir>] [-a|--autotools] [-s|--show] [-B|--no-build] [-h|--help]"
echo "$ $0 [-m|--meson <builddir>] [-s|--show] [-B|--no-build] [-h|--help]"
echo ""
echo "Configure NetworkManager in a way that is similar to when building"
echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`make install\`"
echo "RPMs of NetworkManager for Fedora/RHEL. The effect is that \`meson install\`"
echo "will overwrite the files in /usr that you installed via the package management"
echo "systemd. Also, subsequent \`systemctl restart NetworkManager\` works."
echo "You don't want to do this on your real system, because it messes up your"
@@ -44,14 +44,7 @@ usage() {
}
get_version() {
local major minor micro
local F="./configure.ac"
vars="$(sed -n 's/^m4_define(\[nm_\(major\|minor\|micro\)_version\], *\[\([0-9]\+\)\]) *$/local \1='\''\2'\''/p' "$F" 2>/dev/null)"
eval "$vars"
[[ -n "$major" && -n "$minor" && "$micro" ]] || return 1
echo "$major.$minor.$micro"
grep -E -m1 '^\s+version:' meson.build | cut -d"'" -f2
}
bool() {
@@ -149,7 +142,6 @@ P_NOBUILD="${NOBUILD-0}"
P_DEBUG="${DEBUG-1}"
P_BUILD_TYPE="${BUILD_TYPE-meson}"
P_MESON_BUILDDIR="${MESON_BUILDDIR-./build}"
[ -n "$MESON_BUILDDIR" ] && P_MESON_BUILDDIR_FORCE=1
P_CFLAGS="${CFLAGS-}"
@@ -313,14 +305,10 @@ while [[ $# -gt 0 ]] ; do
shift
case "$A" in
--meson|-m)
P_BUILD_TYPE=meson
P_MESON_BUILDDIR="$1"
P_MESON_BUILDDIR_FORCE=1
shift
;;
--autotools|-a)
P_BUILD_TYPE=autotools
;;
-s|--show)
SHOW_CMD=show_cmd
;;
@@ -338,7 +326,7 @@ while [[ $# -gt 0 ]] ; do
esac
done
if [ "$P_BUILD_TYPE" = meson -a "$P_MESON_BUILDDIR_FORCE" != 1 ]; then
if [ "$P_MESON_BUILDDIR_FORCE" != 1 ]; then
if [ -d "$P_MESON_BUILDDIR" ]; then
echo "Build directory '$P_MESON_BUILDDIR' chosen by default, but it exists and will be overwritten." \
"If you really want that, pass '--meson \"$P_MESON_BUILDDIR\"'." >&2
@@ -348,181 +336,89 @@ fi
vars_with_vals
if [ "$P_BUILD_TYPE" == meson ] ; then
MESON_RECONFIGURE=
if test -d "$P_MESON_BUILDDIR" ; then
MESON_RECONFIGURE="--reconfigure"
fi
$SHOW_CMD \
env \
CC="$P_CC" \
CFLAGS="$P_CFLAGS" \
meson setup\
$MESON_RECONFIGURE \
--buildtype=plain \
--prefix="$D_PREFIX" \
--libdir="$D_LIBDIR" \
--libexecdir="$D_LIBEXECDIR" \
--bindir="$D_BINDIR" \
--sbindir="$D_SBINDIR" \
--includedir="$D_INCLUDEDIR" \
--datadir="$D_DATADIR" \
--mandir="$D_MANDIR" \
--infodir="$D_INFODIR" \
--localedir="$D_DATADIR"/locale \
--sysconfdir="$D_SYSCONFDIR" \
--localstatedir="$D_LOCALSTATEDIR" \
--sharedstatedir="$D_SHAREDSTATEDIR" \
--wrap-mode=nodownload \
--auto-features=enabled \
-Db_ndebug=false \
--warnlevel 2 \
$(args_enable "$P_TEST" --werror) \
-Dnft="${D_SBINDIR}/nft" \
-Diptables="${D_SBINDIR}/iptables" \
-Ddhclient="${D_SBINDIR}/dhclient" \
-Ddhcpcanon=no \
-Ddhcpcd=no \
-Dconfig_dhcp_default="$P_DHCP_DEFAULT" \
"-Dcrypto=$P_CRYPTO" \
$(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \
$(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \
-Dld_gc=true \
-Db_lto="$(bool_true "$P_LTO")" \
-Dlibaudit=yes-disabled-by-default \
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
-Diwd="$(bool_true "$P_IWD")" \
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
-Dnmtui="$(bool_true "$P_NMTUI")" \
-Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \
-Dvapi=true \
-Dintrospection=true \
-Ddocs="$(bool_true "$P_REGEN_DOCS")" \
-Dteamdctl="$(bool_true "$P_TEAM")" \
-Dovs="$(bool_true "$P_OVS")" \
-Dselinux=true \
-Dpolkit=true \
-Dconfig_auth_polkit_default=true \
-Dmodify_system=true \
-Dconcheck=true \
-Dlibpsl="$(bool_true "$P_FEDORA")" \
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
-Dsession_tracking=systemd \
-Dsuspend_resume=systemd \
-Dsystemdsystemunitdir=/usr/lib/systemd/system \
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
-Dtests=yes \
-Dvalgrind=no \
-Difcfg_rh=true \
-Difupdown=false \
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \
-Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \
-Ddist_version="$P_VERSION-$P_RELEASE" \
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \
-Dresolvconf=no \
-Dnetconfig=no \
-Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \
\
"$P_MESON_BUILDDIR" \
;
else
if ! test -x ./configure ; then
if [ -z "$SHOW_CMD" ]; then
NOCONFIGURE=yes ./autogen.sh
fi
fi
$SHOW_CMD \
./configure \
--build=x86_64-redhat-linux-gnu \
--host=x86_64-redhat-linux-gnu \
--program-prefix= \
--prefix="$D_PREFIX" \
--exec-prefix=/usr \
--bindir="$D_BINDIR" \
--sbindir="$D_SBINDIR" \
--sysconfdir="$D_SYSCONFDIR" \
--datadir="$D_DATADIR" \
--includedir="$D_INCLUDEDIR" \
--libdir="$D_LIBDIR" \
--libexecdir="$D_LIBEXECDIR" \
--localstatedir="$D_LOCALSTATEDIR" \
--sharedstatedir="$D_SHAREDSTATEDIR" \
--mandir="$D_MANDIR" \
--infodir="$D_INFODIR" \
\
CC="$P_CC" \
CFLAGS="$P_CFLAGS" \
\
--enable-dependency-tracking=yes \
\
--with-runstatedir="$D_RUNDIR" \
--enable-silent-rules="$(bool_yes "$P_SILENT_RULES")" \
--enable-static=no \
--with-nft="${D_SBINDIR}/nft" \
--with-iptables="${D_SBINDIR}/iptables" \
--with-dhclient="${D_SBINDIR}/dhclient" \
--with-dhcpcd=no \
--with-dhcpcanon=no \
--with-config-dhcp-default="$P_DHCP_DEFAULT" \
--with-crypto="$P_CRYPTO" \
$(args_enable "$P_SANITIZER" --with-address-sanitizer=exec --enable-undefined-sanitizer="$( (bool "$P_FEDORA" || test "$P_RHEL" -ge 8) && echo yes || echo no)" ) \
$(args_enable "$(bool_not_true "$P_SANITIZER")" --with-address-sanitizer=no --enable-undefined-sanitizer=no ) \
$(args_enable "$P_DEBUG" --enable-more-logging=yes --with-more-asserts=10000) \
$(args_enable "$(bool_not_true "$P_DEBUG")" --enable-more-logging=no --with-more-asserts=0 ) \
--enable-ld-gc=yes \
--enable-lto="$(bool_yes "$P_LTO")" \
--with-libaudit=yes-disabled-by-default \
--with-modem-manager-1="$(bool_yes "$P_MODEM_MANAGER_1")" \
$(args_enable "$P_WIFI" --enable-wifi=yes --with-wext="$(bool_yes "$P_FEDORA")") \
$(args_enable "$(bool_not_true "$P_WIFI")" --enable-wifi=no ) \
--with-iwd="$(bool_yes "$P_IWD")" \
--enable-bluez5-dun="$(bool_yes "$P_BLUETOOTH")" \
--with-nmtui="$(bool_yes "$P_NMTUI")" \
--with-nm-cloud-setup="$(bool_yes "$P_NM_CLOUD_SETUP")" \
--enable-vala=yes \
--enable-introspection=yes \
--enable-gtk-doc="$(bool_yes "$P_REGEN_DOCS")" \
--enable-teamdctl="$(bool_yes "$P_TEAM")" \
--enable-ovs="$(bool_yes "$P_OVS")" \
--with-selinux=yes \
--enable-polkit=yes \
--enable-modify-system=yes \
--enable-concheck=yes \
--with-libpsl="$(bool_yes "$P_FEDORA")" \
--with-ebpf="$(bool_yes "$P_EBPF_ENABLED")" \
--with-session-tracking=systemd \
--with-suspend-resume=systemd \
--with-systemdsystemunitdir=/usr/lib/systemd/system \
--with-system-ca-path=/etc/pki/tls/cert.pem \
--with-dbus-sys-dir="$P_DBUS_SYS_DIR" \
--with-tests=yes \
--enable-more-warnings="$(bool "$P_TEST" && echo error || echo yes)" \
--with-valgrind=no \
--enable-ifcfg-rh=yes \
--enable-ifupdown=no \
$(args_enable "$P_PPP" --enable-ppp=yes --with-pppd="$D_SBINDIR/pppd" --with-pppd-plugin-dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
$(args_enable "$(bool_not_true "$P_PPP")" --enable-ppp=no ) \
--enable-firewalld-zone="$(bool_yes "$P_FIREWALLD_ZONE")" \
--with-dist-version="$P_VERSION-$P_RELEASE" \
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" --with-config-plugins-default=ifcfg-rh) \
--with-resolvconf=no \
--with-netconfig=no \
--with-config-dns-rc-manager-default="$P_DNS_RC_MANAGER_DEFAULT" \
--with-config-logging-backend-default="$P_LOGGING_BACKEND_DEFAULT" \
--disable-autotools-deprecation \
;
MESON_RECONFIGURE=
if test -d "$P_MESON_BUILDDIR" ; then
MESON_RECONFIGURE="--reconfigure"
fi
$SHOW_CMD \
env \
CC="$P_CC" \
CFLAGS="$P_CFLAGS" \
meson setup\
$MESON_RECONFIGURE \
--buildtype=plain \
--prefix="$D_PREFIX" \
--libdir="$D_LIBDIR" \
--libexecdir="$D_LIBEXECDIR" \
--bindir="$D_BINDIR" \
--sbindir="$D_SBINDIR" \
--includedir="$D_INCLUDEDIR" \
--datadir="$D_DATADIR" \
--mandir="$D_MANDIR" \
--infodir="$D_INFODIR" \
--localedir="$D_DATADIR"/locale \
--sysconfdir="$D_SYSCONFDIR" \
--localstatedir="$D_LOCALSTATEDIR" \
--sharedstatedir="$D_SHAREDSTATEDIR" \
--wrap-mode=nodownload \
--auto-features=enabled \
-Db_ndebug=false \
--warnlevel 2 \
$(args_enable "$P_TEST" --werror) \
-Dnft="${D_SBINDIR}/nft" \
-Diptables="${D_SBINDIR}/iptables" \
-Dip6tables="${D_SBINDIR}/ip6tables" \
-Ddhclient="${D_SBINDIR}/dhclient" \
-Ddhcpcd=no \
-Dconfig_dhcp_default="$P_DHCP_DEFAULT" \
"-Dcrypto=$P_CRYPTO" \
$(args_enable "$P_DEBUG" -Dmore_logging=true -Dmore_asserts=10000) \
$(args_enable "$(bool_not_true "$P_DEBUG")" -Dmore_logging=false -Dmore_asserts=0 ) \
-Dld_gc=true \
-Db_lto="$(bool_true "$P_LTO")" \
-Dlibaudit=yes-disabled-by-default \
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
-Diwd="$(bool_true "$P_IWD")" \
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
-Dnmtui="$(bool_true "$P_NMTUI")" \
-Dnm_cloud_setup="$(bool_true "$P_NM_CLOUD_SETUP")" \
-Dvapi=true \
-Dintrospection=true \
-Ddocs="$(bool_true "$P_REGEN_DOCS")" \
-Dteamdctl="$(bool_true "$P_TEAM")" \
-Dovs="$(bool_true "$P_OVS")" \
-Dselinux=true \
-Dpolkit=true \
-Dconfig_auth_polkit_default=true \
-Dmodify_system=true \
-Dconcheck=true \
-Dlibpsl="$(bool_true "$P_FEDORA")" \
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
-Dsession_tracking=systemd \
-Dsuspend_resume=systemd \
-Dsystemdsystemunitdir=/usr/lib/systemd/system \
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
-Dtests=yes \
-Dvalgrind=no \
-Difcfg_rh=true \
-Difupdown=false \
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \
-Dfirewalld_zone="$(bool_true "$P_FIREWALLD_ZONE}")" \
-Ddist_version="$P_VERSION-$P_RELEASE" \
$(args_enable "$P_CONFIG_PLUGINS_DEFAULT_IFCFG_RH" -Dconfig_plugins_default=ifcfg-rh) \
-Dresolvconf=no \
-Dnetconfig=no \
-Dconfig_dns_rc_manager_default="$P_DNS_RC_MANAGER_DEFAULT" \
-Dconfig_logging_backend_default="$P_LOGGING_BACKEND_DEFAULT" \
\
"$P_MESON_BUILDDIR" \
;
if ! bool "$P_NOBUILD" ; then
if [ "$P_BUILD_TYPE" == meson ] ; then
$SHOW_CMD ninja -C "$P_MESON_BUILDDIR"
else
$SHOW_CMD make -j 10
fi
$SHOW_CMD ninja -C "$P_MESON_BUILDDIR"
fi

View File

@@ -27,7 +27,8 @@
# * Run in a "clean" environment, i.e. no unusual environment variables set, on a recent
# Fedora, with suitable dependencies installed.
#
# * First, ensure that you have ssh keys for "master.gnome.org" installed (and ssh-agent running).
# * First, ensure that you have a valid Gitlab's private token for gitlab.freedestkop.org
# stored in ~/.config/nm-release-token, or pass one with --gitlab-token argument.
# Also, ensure you have a GPG key that you want to use for signing. Also, have gpg-agent running
# and possibly configure `git config --get user.signingkey` for the proper key.
#
@@ -39,9 +40,13 @@
#
# Run with --no-test to do the actual release.
die() {
fail_msg() {
echo -n "FAIL: "
echo_color 31 "$@"
}
die() {
fail_msg "$@"
exit 1
}
@@ -63,12 +68,13 @@ print_usage() {
echo " [--no-check-gitlab] \\"
echo " [--no-check-news] \\"
echo " [--no-warn-publish-docs] \\"
echo " [--gitlab-token <private_gitlab_token>] \\"
}
die_help() {
print_usage
echo
sed -e '/^# /,/# Run with --no-test/!d' -e 's/^#\($\| \)/ /' "$BASH_SOURCE"
sed -e '2,/^$/!d' -e 's/^#\($\| \)/ /' "$BASH_SOURCE"
exit 0
}
@@ -93,14 +99,17 @@ do_command() {
fi
}
SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
GITDIR="$(cd "$SCRIPTDIR" && git rev-parse --show-toplevel || die "Could not get GITDIR")"
parse_version() {
local MAJ="$(sed -n '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
local MIN="$(sed -n '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
local MIC="$(sed -n '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/\1/p' ./configure.ac)"
local VERSION=$(grep -E -m1 '^\s+version:' "$GITDIR/meson.build" \
| cut -d"'" -f2 \
| sed 's/\./ /g')
re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$'
[[ "$MAJ $MIN $MIC" =~ $re ]] || return 1
echo "$MAJ $MIN $MIC"
[[ "$VERSION" =~ $re ]] || return 1
echo "$VERSION"
}
number_is_even() {
@@ -124,7 +133,7 @@ check_gitlab_pipeline() {
local SHA="$2"
local PIPELINE_ID
PIPELINE_ID="$(curl --no-progress-meter "https://gitlab.freedesktop.org/api/v4/projects/411/pipelines?ref=$BRANCH&sha=$SHA&order_by=id" 2>/dev/null | jq '.[0].id')"
PIPELINE_ID="$(curl --no-progress-meter "https://gitlab.freedesktop.org/api/v4/projects/411/pipelines?ref=$BRANCH&sha=$SHA&source=push&order_by=id" 2>/dev/null | jq '.[0].id')"
if ! [[ $PIPELINE_ID =~ [0-9]+ ]] ; then
echo "Cannot find pipeline for branch $BRANCH. Check \"https://gitlab.freedesktop.org/NetworkManager/NetworkManager/pipelines?page=1&scope=branches&ref=$BRANCH\""
return 1
@@ -144,25 +153,12 @@ check_gitlab_pipeline() {
return 0
}
set_version_number_autotools() {
sed -i \
-e '1,20 s/^m4_define(\[nm_major_version\], \[\([0-9]\+\)\])$/m4_define([nm_major_version], ['"$1"'])/' \
-e '1,20 s/^m4_define(\[nm_minor_version\], \[\([0-9]\+\)\])$/m4_define([nm_minor_version], ['"$2"'])/' \
-e '1,20 s/^m4_define(\[nm_micro_version\], \[\([0-9]\+\)\])$/m4_define([nm_micro_version], ['"$3"'])/' \
./configure.ac
}
set_version_number_meson() {
set_version_number() {
sed -i \
-e '1,20 s/^\( *version: *'\''\)[0-9]\+\.[0-9]\+\.[0-9]\+\('\'',\)$/\1'"$1.$2.$3"'\2/' \
meson.build
}
set_version_number() {
set_version_number_autotools "$@" &&
set_version_number_meson "$@"
}
check_news() {
local mode="$1"
shift
@@ -245,6 +241,11 @@ while [ "$#" -ge 1 ]; do
--help|-h)
die_help
;;
--gitlab-token)
[ "$#" -ge 1 ] || die_usage "provide a value for --gitlab-token"
GITLAB_TOKEN="$1"
shift
;;
devel|rc1|rc|major|major-post|minor)
[ -z "$RELEASE_MODE" ] || die_usage "duplicate release-mode"
RELEASE_MODE="$A"
@@ -411,7 +412,7 @@ fi
if [ $CHECK_GITLAB = 1 ]; then
if ! check_gitlab_pipeline "$CUR_BRANCH" "$CUR_HEAD" ; then
echo "Check the pipelines for branch \"$CUR_BRANCH\" at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/pipelines?ref=$CUR_BRANCH"
echo "Check the pipelines for branch \"$CUR_BRANCH\" at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/pipelines?ref=$CUR_BRANCH&source=push"
echo "Wait for pipeline with \`ci-fairy wait-for-pipeline --project NetworkManager/NetworkManager --sha \"$CUR_HEAD\"\`"
die "It seems not all gitlab-ci jobs were running/succeeding. Skip this check with --no-check-gitlab"
fi
@@ -511,27 +512,23 @@ case "$RELEASE_MODE" in
esac
build_tag() {
local BUILD_TAG="$1"
local TAR_FILE="NetworkManager-$2.tar.xz"
local SUM_FILE="$TAR_FILE.sha256sum"
git checkout "$BUILD_TAG" || die "failed to checkout $BUILD_TAG"
./contrib/fedora/rpm/build_clean.sh -r || die "build release failed"
test -f "./build/meson-dist/$RELEASE_FILE" \
|| die "release file \"./build/meson-dist/$RELEASE_FILE\" not found"
cp "./build/meson-dist/$RELEASE_FILE" /tmp/ || die "failed to copy release tarball to /tmp"
if test -f "./build/meson-dist/$RELEASE_FILE.sig" ; then
cp "./build/meson-dist/$RELEASE_FILE.sig" /tmp/ || die "failed to copy signature for tarball to /tmp"
fi
cp "./build/meson-dist/$TAR_FILE" /tmp/ || die "failed to copy $TAR_FILE to /tmp"
cp "./build/meson-dist/$SUM_FILE" /tmp/ || die "failed to copy $SUM_FILE to /tmp"
git clean -fdx
}
RELEASE_FILES=()
RELEASE_TAR_VERSIONS=()
RELEASE_TAGS=()
if [ -n "$BUILD_TAG" ]; then
RELEASE_FILE="NetworkManager-$TAR_VERSION.tar.xz"
RELEASE_FILES+=("$RELEASE_FILE")
build_tag
build_tag "$BUILD_TAG" "$TAR_VERSION"
RELEASE_TAR_VERSIONS+=("$TAR_VERSION")
RELEASE_TAGS+=("$BUILD_TAG")
fi
git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
@@ -541,9 +538,6 @@ if [ "$RELEASE_MODE" = rc1 ]; then
git branch "$RELEASE_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
BRANCHES+=( "$RELEASE_BRANCH" )
CLEANUP_REFS+=( "refs/heads/$RELEASE_BRANCH" )
fi
if [ "$RELEASE_MODE" = rc1 ]; then
git checkout "$TMP_BRANCH"
b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 2)).0"
set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 2))" 0
@@ -553,29 +547,88 @@ if [ "$RELEASE_MODE" = rc1 ]; then
CLEANUP_REFS+=("refs/tags/$b-dev")
BUILD_TAG="$b-dev"
TAR_VERSION="$b"
RELEASE_FILE="NetworkManager-$TAR_VERSION.tar.xz"
RELEASE_FILES+=("$RELEASE_FILE")
build_tag
build_tag "$BUILD_TAG" "$TAR_VERSION"
RELEASE_TAR_VERSIONS+=("$TAR_VERSION")
RELEASE_TAGS+=("$BUILD_TAG")
git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
fi
if ! [ "$DRY_RUN" = 0 ]; then
ssh master.gnome.org true || die "failed to \`ssh master.gnome.org\`"
if [[ $GITLAB_TOKEN == "" ]]; then
[[ -r ~/.config/nm-release-token ]] || die "cannot read ~/.config/nm-release-token"
GITLAB_TOKEN=$(< ~/.config/nm-release-token)
fi
for r in "${RELEASE_FILES[@]}"; do
do_command rsync -va --append-verify -P "/tmp/$r" master.gnome.org: || die "failed to rsync \"/tmp/$r\""
done
# This step is not necessary for authentication, we use it only to provide a meaningful error message.
GITLAB_USER_ID=$(curl --request GET --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
"https://gitlab.freedesktop.org/api/v4/personal_access_tokens/self" 2>/dev/null | jq ".user_id" || true)
if [ -z "$GITLAB_USER_ID" ] || [ "$GITLAB_USER_ID" = "null" ]; then
die "failed to authenticate to gitlab.freedesktop.org with the private token"
fi
do_command git push "$ORIGIN" "${BRANCHES[@]}" || die "failed to to push branches ${BRANCHES[@]} to $ORIGIN"
FAIL=0
for r in "${RELEASE_FILES[@]}"; do
do_command ssh master.gnome.org ftpadmin install --unattended "$r" || FAIL=1
CREATE_RELEASE_FAIL=0
for I in "${!RELEASE_TAR_VERSIONS[@]}"; do
TAR_FILE="NetworkManager-${RELEASE_TAR_VERSIONS[$I]}.tar.xz"
SUM_FILE="$TAR_FILE.sha256sum"
BUILD_TAG="${RELEASE_TAGS["$I"]}"
FAIL=0
# upload tarball and checksum file as generic packages
for F in "$TAR_FILE" "$SUM_FILE"; do
do_command curl --location --fail-with-body --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--upload-file "/tmp/$F" \
"https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$F" \
|| FAIL=1
if [[ $FAIL = 1 ]]; then
fail_msg "failed to upload $F"
CREATE_RELEASE_FAIL=1
break
fi
done
[[ $FAIL = 1 ]] && continue
# create release
do_command curl --location --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--request POST "https://gitlab.freedesktop.org/api/v4/projects/411/releases" \
--data "$(cat <<END
{
"name": "NetworkManager $BUILD_TAG",
"tag_name": "$BUILD_TAG",
"assets": {
"links": [
{
"name": "NetworkManager $BUILD_TAG tarball with docs",
"url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$TAR_FILE",
"direct_asset_path": "/$TAR_FILE",
"link_type":"package"
},
{
"name": "NetworkManager $BUILD_TAG tarball sha256sum",
"url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$SUM_FILE",
"direct_asset_path": "/$SUM_FILE",
"link_type":"package"
},
{
"name": "NEWS",
"url": "https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/$BUILD_TAG/NEWS?ref_type=tags",
"direct_asset_path": "/NEWS",
"link_type":"other"
}
]
}
}
END
)" || FAIL=1
if [[ $? != 0 ]]; then
fail_msg "failed to create NetworkManager $BUILD_TAG release"
CREATE_RELEASE_FAIL=1
continue
fi
done
if [ "$FAIL" = 1 ]; then
die "ftpadmin install failed. This was the last step. Invoke the command manually"
fi
CLEANUP_CHECKOUT_BRANCH=
if [ "$DRY_RUN" = 0 ]; then
@@ -586,3 +639,7 @@ else
git checkout -B "$CUR_BRANCH" "$CUR_HEAD" || die "cannot reset $CUR_BRANCH to $CUR_HEAD"
echo "delete reference. Restore with $(echo_color 36 -n git checkout -B "\"$CUR_BRANCH\"" "$H")"
fi
if [[ $CREATE_RELEASE_FAIL == 1 ]]; then
die "failed creating the release at gitlab.freedesktop.org. This was the last step, create it manually from the web UI"
fi

View File

@@ -262,6 +262,14 @@ detect_dirname() {
# the unpacked tarball (that is, stripping the suffix).
for T in $(ls -1 "$BUILD_TYPE"*"$suffix" 2>/dev/null); do
D="${T%$suffix}"
# At some point FEDPKG changed the behavior of "prep" command
# now it generates the directory with "-build" suffix and the
# real directory inside. We just move it out.
if [ -d "$D-build" ]; then
rm -rf "$D"
mv "$D-build/$D" .
rm -rf "$D-build"
fi
[[ -d "$D" ]] && DIRS=("${DIRS[@]}" "$D")
done
done

View File

@@ -203,7 +203,7 @@ complain ("Don't use g_direct_equal() for hash tables, pass NULL for pointer equ
complain ("Prefer nm_pint_hash()/nm_pint64_hash()/nm_pdouble_hash() over g_int_hash()/g_int64_hash()/g_double_hash(). Those use siphash24") if $line =~ /\b(g_int_hash|g_int64_hash|g_double_hash)\b/;
complain ("Prefer nm_pint_equal()/nm_pint64_equal()/nm_pdouble_equal() over g_int_equal()/g_int64_equal()/g_double_equal(). Those names mirror our nm_p*_hash() functions") if $line =~ /\b(g_int_equal|g_int64_equal|g_double_equal)\b/;
complain ("Avoid g_clear_pointer() and use nm_clear_pointer() (or nm_clear_g_free(), g_clear_object(), etc.)") if $line =~ /\b(g_clear_pointer)\b/;
complain ("Define setting properties with _nm_setting_property_define_direct_*() API") if $line =~ /g_param_spec_/ and $filename =~ /\/libnm-core-impl\/nm-setting/;
complain ("Define setting properties with _nm_setting_property_define_direct_*() API") if $line =~ /g_param_spec_/ and $filename =~ /\/libnm-core-impl\/nm-setting/ and (not $filename =~ /\/nm-setting-ip-config.c$/);
complain ("Use nm_g_array_{index,first,last,index_p}() instead of g_array_index(), as it nm_assert()s for valid element size and out-of-bound access") if $line =~ /\bg_array_index\b/;
complain ("Use spaces instead of tabs") if $line =~ /\t/;
complain ("Prefer implementing private pointers via _NM_GET_PRIVATE() or _NM_GET_PRIVATE_PTR() (the latter, if the private data has an opqaue pointer in the header file)") if $line =~ /\b(g_type_class_add_private|G_TYPE_INSTANCE_GET_PRIVATE)\b/;

View File

@@ -193,7 +193,9 @@ def git_ref_commit_body(ref):
def git_ref_commit_body_get_fixes(ref):
body = git_ref_commit_body(ref)
result = []
for mo in re.finditer(re_bin("\\b[fF]ixes: *([0-9a-z]+)\\b"), body):
for mo in re.finditer(
re_bin("^\\s*[fF]ixes: *([0-9a-z]+)\\b"), body, flags=re.MULTILINE
):
c = mo.group(1).decode("ascii")
h = git_ref_exists(c)
if h:
@@ -202,7 +204,9 @@ def git_ref_commit_body_get_fixes(ref):
# The commit that contains a "Fixes:" line, can also contain an "Ignore-Fixes:" line
# to disable it. This only makes sense with refs/notes/bugs notes, to fix up a wrong
# annotation.
for mo in re.finditer(re_bin("\\bIgnore-[fF]ixes: *([0-9a-z]+)\\b"), body):
for mo in re.finditer(
re_bin("^\\s*Ignore-[fF]ixes: *([0-9a-z]+)\\b"), body, flags=re.MULTILINE
):
c = mo.group(1).decode("ascii")
h = git_ref_exists(c)
try:

View File

@@ -1,40 +0,0 @@
#!/bin/bash
# patch gtk-doc for https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2
cd /
patch -f -p 1 --fuzz 0 --reject-file=- <<EOF
diff --git a/usr/share/gtk-doc/python/gtkdoc/scan.py b/usr/share/gtk-doc/python/gtkdoc/scan.py
index f1f167235ab2e4c62676fbcfb87ebbe55c95b944..b59dd17abfa5f42b7bb06d239f9c78e5efffbf5d 100644
--- a/usr/share/gtk-doc/python/gtkdoc/scan.py
+++ b/usr/share/gtk-doc/python/gtkdoc/scan.py
@@ -427,20 +427,26 @@ def ScanHeader(input_file, section_list, decl_list, get_types, options):
elif m9:
# We've found a 'typedef struct _<name> <name>;'
# This could be an opaque data structure, so we output an
# empty declaration. If the structure is actually found that
# will override this.
structsym = m9.group(1).upper()
logging.info('%s typedef: "%s"', structsym, m9.group(2))
forward_decls[m9.group(2)] = '<%s>\n<NAME>%s</NAME>\n%s</%s>\n' % (
structsym, m9.group(2), deprecated, structsym)
+ bm = re.search(r'^(\S+)(Class|Iface|Interface)\b', m9.group(2))
+ if bm:
+ objectname = bm.group(1)
+ logging.info('Found object: "%s"', objectname)
+ title = '<TITLE>%s</TITLE>' % objectname
+
elif re.search(r'^\s*(?:struct|union)\s+_(\w+)\s*;', line):
# Skip private structs/unions.
logging.info('private struct/union')
elif m10:
# Do a similar thing for normal structs as for typedefs above.
# But we output the declaration as well in this case, so we
# can differentiate it from a typedef.
structsym = m10.group(1).upper()
logging.info('%s:%s', structsym, m10.group(2))
EOF

View File

@@ -3,7 +3,6 @@
# Arguments via environment variables:
# - CI
# - CC
# - BUILD_TYPE
# - CFLAGS
# - WITH_DOCS
@@ -50,23 +49,18 @@ grep -q '^NAME=.*\(Alpine\)' /etc/os-release && IS_ALPINE=1
###############################################################################
if [ "$BUILD_TYPE" == meson ]; then
_TRUE=true
_FALSE=false
elif [ "$BUILD_TYPE" == autotools ]; then
_TRUE=yes
_FALSE=no
else
die "invalid \$BUILD_TYPE \"$BUILD_TYPE\""
fi
_WITH_CRYPTO="gnutls"
_WITH_WERROR=1
_WITH_LIBTEAM="$_TRUE"
_WITH_DOCS="$_TRUE"
_WITH_SYSTEMD_LOGIND="$_TRUE"
_WITH_LIBTEAM="true"
_WITH_DOCS="true"
_WITH_SYSTEMD_LOGIND="true"
_WITH_NBFT="true"
if [ $IS_ALPINE = 1 ]; then
_WITH_SYSTEMD_LOGIND="$_FALSE"
_WITH_SYSTEMD_LOGIND="false"
fi
if ! pkgconf 'libnvme >= 1.5'; then
_WITH_NBFT="false"
fi
if [ -z "${NMTST_SEED_RAND+x}" ]; then
@@ -92,9 +86,9 @@ fi
if [ "$WITH_DOCS" != "" ]; then
if _is_true "$WITH_DOCS"; then
_WITH_DOCS="$_TRUE"
_WITH_DOCS="true"
else
_WITH_DOCS="$_FALSE"
_WITH_DOCS="false"
fi
fi
@@ -149,149 +143,74 @@ _print_test_logs() {
fi
}
run_autotools() {
NOCONFIGURE=1 ./autogen.sh
mkdir ./build
if [ "$_WITH_WERROR" == 1 ]; then
_WITH_WERROR_VAL="error"
else
_WITH_WERROR_VAL="yes"
fi
DISABLE_DEPENDENCY_TRACKING=
if [ $IS_ALPINE = 1 ]; then
DISABLE_DEPENDENCY_TRACKING='--disable-dependency-tracking'
fi
pushd ./build
../configure \
--prefix="$PWD/INST" \
$DISABLE_DEPENDENCY_TRACKING \
\
--enable-introspection=$_WITH_DOCS \
--enable-gtk-doc=$_WITH_DOCS \
--with-systemd-logind=$_WITH_SYSTEMD_LOGIND \
--enable-more-warnings="$_WITH_WERROR_VAL" \
--enable-tests=yes \
--with-crypto=$_WITH_CRYPTO \
\
--with-ebpf=no \
\
--with-iwd=yes \
--with-ofono=yes \
--enable-teamdctl=$_WITH_LIBTEAM \
\
--with-dhcpcanon=yes \
--with-dhcpcd=yes \
--with-dhclient=yes \
\
--with-netconfig=/bin/nowhere/netconfig \
--with-resolvconf=/bin/nowhere/resolvconf \
\
--enable-ifcfg-rh=yes \
--enable-ifupdown=yes \
--disable-autotools-deprecation \
\
#end
if [ "$CONFIGURE_ONLY" != 1 ]; then
make -j 6
make install
export NM_TEST_CLIENT_CHECK_L10N=1
if ! make check -j 6 -k ; then
_print_test_logs "first-test"
echo ">>>> RUN SECOND TEST (start)"
NMTST_DEBUG="debug,TRACE,no-expect-message" make check -k || :
echo ">>>> RUN SECOND TEST (done)"
_print_test_logs "second-test"
die "autotools test failed"
fi
if _with_valgrind; then
if ! NMTST_USE_VALGRIND=1 make check -j 3 -k ; then
_print_test_logs "(valgrind test)"
die "autotools+valgrind test failed"
fi
fi
fi
popd
}
###############################################################################
run_meson() {
if [ "$_WITH_WERROR" == 1 ]; then
_WITH_WERROR_VAL="--werror"
else
_WITH_WERROR_VAL=""
if [ "$_WITH_WERROR" == 1 ]; then
_WITH_WERROR_VAL="--werror"
else
_WITH_WERROR_VAL=""
fi
meson setup build \
\
-Dprefix="$PWD/INST" \
\
--warnlevel 2 \
$_WITH_WERROR_VAL \
\
-D ld_gc=false \
-D session_tracking=no \
-D systemdsystemunitdir=no \
-D systemd_journal=false \
-D selinux=false \
-D libaudit=no \
-D libpsl=false \
-D vapi=false \
-D introspection=$_WITH_DOCS \
-D man=$_WITH_DOCS \
-D qt=false \
-D crypto=$_WITH_CRYPTO \
-D docs=$_WITH_DOCS \
\
-D ebpf=false \
\
-D iwd=true \
-D ofono=true \
-D teamdctl=$_WITH_LIBTEAM \
\
-D dhclient=/bin/nowhere/dhclient \
-D dhcpcd=/bin/nowhere/dhcpd \
\
-D netconfig=/bin/nowhere/netconfig \
-D resolvconf=/bin/nowhere/resolvconf \
\
-D ifcfg_rh=false \
-D ifupdown=true \
\
-D nbft=$_WITH_NBFT \
\
#end
export NM_TEST_CLIENT_CHECK_L10N=1
if [ "$CONFIGURE_ONLY" != 1 ]; then
ninja -C build -v
ninja -C build install
if ! meson test -C build -v --print-errorlogs ; then
echo ">>>> RUN SECOND TEST (start)"
NMTST_DEBUG="debug,TRACE,no-expect-message" \
meson test -C build -v --print-errorlogs || :
echo ">>>> RUN SECOND TEST (done)"
die "meson test failed"
fi
meson setup build \
\
-Dprefix="$PWD/INST" \
\
--warnlevel 2 \
$_WITH_WERROR_VAL \
\
-D ld_gc=false \
-D session_tracking=no \
-D systemdsystemunitdir=no \
-D systemd_journal=false \
-D selinux=false \
-D libaudit=no \
-D libpsl=false \
-D vapi=false \
-D introspection=$_WITH_DOCS \
-D qt=false \
-D crypto=$_WITH_CRYPTO \
-D docs=$_WITH_DOCS \
\
-D ebpf=false \
\
-D iwd=true \
-D ofono=true \
-D teamdctl=$_WITH_LIBTEAM \
\
-D dhclient=/bin/nowhere/dhclient \
-D dhcpcanon=/bin/nowhere/dhcpcanon \
-D dhcpcd=/bin/nowhere/dhcpd \
\
-D netconfig=/bin/nowhere/netconfig \
-D resolvconf=/bin/nowhere/resolvconf \
\
-D ifcfg_rh=false \
-D ifupdown=true \
\
#end
export NM_TEST_CLIENT_CHECK_L10N=1
if [ "$CONFIGURE_ONLY" != 1 ]; then
ninja -C build -v
ninja -C build install
if ! meson test -C build -v --print-errorlogs ; then
echo ">>>> RUN SECOND TEST (start)"
NMTST_DEBUG="debug,TRACE,no-expect-message" \
meson test -C build -v --print-errorlogs || :
echo ">>>> RUN SECOND TEST (done)"
die "meson test failed"
fi
if _with_valgrind; then
if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then
_print_test_logs "(valgrind test)"
die "meson+valgrind test failed"
fi
if _with_valgrind; then
if ! NMTST_USE_VALGRIND=1 meson test -C build -v --print-errorlogs ; then
_print_test_logs "(valgrind test)"
die "meson+valgrind test failed"
fi
fi
}
###############################################################################
if [ "$BUILD_TYPE" == autotools ]; then
run_autotools
elif [ "$BUILD_TYPE" == meson ]; then
run_meson
fi
if [ "$USE_CCACHE" = 1 ]; then

View File

@@ -70,7 +70,7 @@ get_nm_git_bundle() {
if [ -n "${NM_GIT_BUNDLE+x}" ]; then
return 0
fi
NM_GIT_BUNDLE='https://download.copr.fedorainfracloud.org/results/networkmanager/NetworkManager-main/fedora-38-x86_64/06008259-nm-git-bundle/nm-git-bundle-20230606-102458.noarch.rpm'
NM_GIT_BUNDLE='https://download.copr.fedorainfracloud.org/results/networkmanager/NetworkManager-main/fedora-41-x86_64/08367599-nm-git-bundle/nm-git-bundle-20241209-150540.noarch.rpm'
fi
mkdir nm-git-bundle
pushd nm-git-bundle

View File

@@ -0,0 +1,27 @@
[Unit]
Description=NetworkManager Configuration (initrd)
DefaultDependencies=no
Wants=systemd-journald.socket
After=systemd-journald.socket
Before=systemd-udevd.service systemd-udev-trigger.service
ConditionPathExists=/etc/initrd-release
[Service]
Type=oneshot
ExecStartPre=/bin/sh -c "rm -f /run/NetworkManager/system-connections/*"
ExecStart=/bin/sh -c "@libexecdir@/nm-initrd-generator -- $(cat /proc/cmdline)"
ExecStartPost=/bin/sh -c ' \
for i in /{usr/lib,run,etc}/NetworkManager/system-connections/*; do \
[ -f "$i" ] || continue; \
mkdir -p /run/NetworkManager/initrd; \
: > /run/NetworkManager/initrd/neednet; \
break; \
done; \
if [ -s /run/NetworkManager/initrd/hostname ]; then \
cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname; \
fi \
'
RemainAfterExit=yes
[Install]
WantedBy=initrd.target

View File

@@ -0,0 +1,32 @@
[Unit]
Description=NetworkManager (initrd)
DefaultDependencies=no
Wants=systemd-udev-trigger.service network.target
After=systemd-udev-trigger.service network-pre.target dbus.service NetworkManager-config-initrd.service
Before=network.target
BindsTo=dbus.service
ConditionPathExists=/etc/initrd-release
ConditionPathExists=/run/NetworkManager/initrd/neednet
ConditionPathExistsGlob=|/usr/lib/NetworkManager/system-connections/*
ConditionPathExistsGlob=|/run/NetworkManager/system-connections/*
ConditionPathExistsGlob=|/etc/NetworkManager/system-connections/*
[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
ExecStart=@sbindir@/NetworkManager
# NM doesn't want systemd to kill its children for it
KillMode=process
Environment=NM_CONFIG_ENABLE_TAG=initrd
Restart=on-failure
ProtectSystem=true
ProtectHome=read-only
[Install]
WantedBy=initrd.target
# We want to enable NetworkManager-wait-online-initrd.service whenever this
# service is enabled. NetworkManager-wait-online-initrd.service has
# WantedBy=network-online.target, so enabling it only has an effect if
# network-online.target itself is enabled or pulled in by some other unit.
Also=NetworkManager-config-initrd.service NetworkManager-wait-online-initrd.service

View File

@@ -0,0 +1,26 @@
[Unit]
Description=NetworkManager Wait Online (initrd)
DefaultDependencies=no
Requires=NetworkManager-initrd.service
After=NetworkManager-initrd.service
Before=network-online.target
ConditionPathExists=/etc/initrd-release
ConditionPathExists=/run/NetworkManager/initrd/neednet
[Service]
# `nm-online -s` waits until the point when NetworkManager logs
# "startup complete". That is when startup actions are settled and
# devices and profiles reached a conclusive activated or deactivated
# state. It depends on which profiles are configured to autoconnect and
# also depends on profile settings like ipv4.may-fail/ipv6.may-fail,
# which affect when a profile is considered fully activated.
# Check NetworkManager logs to find out why wait-online takes a certain
# time.
Type=oneshot
ExecStart=@bindir@/nm-online -s -q
RemainAfterExit=yes
Environment=NM_ONLINE_TIMEOUT=3600
[Install]
WantedBy=initrd.target network-online.target

View File

@@ -19,7 +19,6 @@ KillMode=process
# With a huge number of interfaces, starting can take a long time.
TimeoutStartSec=600
# CAP_DAC_OVERRIDE: required to open /run/openvswitch/db.sock socket.
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT
ProtectSystem=true

View File

@@ -9,19 +9,28 @@ configure_file(
if install_systemdunitdir
services = [
'NetworkManager-dispatcher.service.in',
'NetworkManager.service.in',
'nm-priv-helper.service.in',
'NetworkManager-wait-online.service.in',
'NetworkManager-dispatcher.service',
'NetworkManager.service',
'nm-priv-helper.service',
'NetworkManager-wait-online.service',
'NetworkManager-config-initrd.service',
'NetworkManager-initrd.service',
'NetworkManager-wait-online-initrd.service',
]
foreach service: services
configure_file(
input: service,
output: '@BASENAME@',
input: service + '.in',
output: service,
install_dir: systemd_systemdsystemunitdir,
configuration: data_conf,
)
test(
'check-' + service,
find_program(join_paths(source_root, 'src/tests/check-systemd-unit.sh')),
args: [ join_paths(meson.current_build_dir(), service) ],
)
endforeach
if enable_ovs

View File

@@ -2,8 +2,8 @@
Description=NetworkManager Privileged Helper
#
# nm-priv-helper exists for privilege separation. It allows to run
# NetworkManager without certain capabilities, and ask nm-priv-helper
# nm-priv-helper exists for privilege separation. It allows NetworkManager
# to run without certain capabilities, and ask nm-priv-helper
# for special operations where more privileges are required.
#

View File

@@ -1,140 +0,0 @@
AUTOMAKE_OPTIONS = 1.7
XSLTPROC = xsltproc --xinclude --nonet
XMLS = $(wildcard $(top_srcdir)/introspection/nm-*.xml)
GENERATED_FILES =
if BUILD_DOCS
GENERATED_FILES += settings-spec.xml
endif
# The name of the module.
DOC_MODULE=NetworkManager
# The top-level SGML file.
DOC_MAIN_SGML_FILE=network-manager-docs.xml
DOC_SOURCE_DIR=$(srcdir)
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--sgml-mode --output-format=xml
# Extra options to supply to gtkdoc-mktmpl
MKTMPL_OPTIONS=
# Extra options to supply to gtkdoc-mkhtml
MKHTML_OPTIONS=--path="$(abs_srcdir)"
# Files to be included in $(DOC_MAIN_SGML_FILE)
content_files = \
$(GENERATED_FILES) \
dbus-org.freedesktop.NetworkManager.AccessPoint.xml \
dbus-org.freedesktop.NetworkManager.AgentManager.xml \
dbus-org.freedesktop.NetworkManager.Connection.Active.xml \
dbus-org.freedesktop.NetworkManager.DHCP4Config.xml \
dbus-org.freedesktop.NetworkManager.DHCP6Config.xml \
dbus-org.freedesktop.NetworkManager.Device.Adsl.xml \
dbus-org.freedesktop.NetworkManager.Device.Bluetooth.xml \
dbus-org.freedesktop.NetworkManager.Device.Bond.xml \
dbus-org.freedesktop.NetworkManager.Device.Bridge.xml \
dbus-org.freedesktop.NetworkManager.Device.Dummy.xml \
dbus-org.freedesktop.NetworkManager.Device.Generic.xml \
dbus-org.freedesktop.NetworkManager.Device.Hsr.xml \
dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml \
dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml \
dbus-org.freedesktop.NetworkManager.Device.Loopback.xml \
dbus-org.freedesktop.NetworkManager.Device.Macsec.xml \
dbus-org.freedesktop.NetworkManager.Device.Macvlan.xml \
dbus-org.freedesktop.NetworkManager.Device.Modem.xml \
dbus-org.freedesktop.NetworkManager.Device.OlpcMesh.xml \
dbus-org.freedesktop.NetworkManager.Device.Statistics.xml \
dbus-org.freedesktop.NetworkManager.Device.Team.xml \
dbus-org.freedesktop.NetworkManager.Device.Tun.xml \
dbus-org.freedesktop.NetworkManager.Device.Veth.xml \
dbus-org.freedesktop.NetworkManager.Device.Vlan.xml \
dbus-org.freedesktop.NetworkManager.Device.Vxlan.xml \
dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml \
dbus-org.freedesktop.NetworkManager.Device.WireGuard.xml \
dbus-org.freedesktop.NetworkManager.Device.Wired.xml \
dbus-org.freedesktop.NetworkManager.Device.Wireless.xml \
dbus-org.freedesktop.NetworkManager.Device.xml \
dbus-org.freedesktop.NetworkManager.DnsManager.xml \
dbus-org.freedesktop.NetworkManager.IP4Config.xml \
dbus-org.freedesktop.NetworkManager.IP6Config.xml \
dbus-org.freedesktop.NetworkManager.PPP.xml \
dbus-org.freedesktop.NetworkManager.SecretAgent.xml \
dbus-org.freedesktop.NetworkManager.Settings.Connection.xml \
dbus-org.freedesktop.NetworkManager.Settings.xml \
dbus-org.freedesktop.NetworkManager.VPN.Connection.xml \
dbus-org.freedesktop.NetworkManager.VPN.Plugin.xml \
dbus-org.freedesktop.NetworkManager.xml \
$(top_builddir)/src/libnm-core-public/nm-dbus-types.xml \
$(top_builddir)/src/libnm-core-public/nm-vpn-dbus-types.xml \
$(top_builddir)/man/nmcli.xml \
$(top_builddir)/man/nmtui.xml \
$(top_builddir)/man/nm-online.xml \
$(top_builddir)/man/nm-initrd-generator.xml \
$(top_builddir)/man/NetworkManager.xml \
$(top_builddir)/man/NetworkManager-dispatcher.xml \
$(top_builddir)/man/NetworkManager.conf.xml \
$(top_builddir)/man/NetworkManager-wait-online.service.xml \
$(top_builddir)/man/nmcli-examples.xml \
$(top_builddir)/man/nm-settings-dbus.xml \
$(top_builddir)/man/nm-settings-keyfile.xml \
$(top_builddir)/man/nm-settings-nmcli.xml \
version.xml \
$(NULL)
if WITH_OPENVSWITCH
content_files += $(top_builddir)/man/nm-openvswitch.xml
endif
if BUILD_NM_CLOUD_SETUP
content_files += $(top_builddir)/man/nm-cloud-setup.xml
endif
if CONFIG_PLUGIN_IFCFG_RH
content_files += $(top_builddir)/man/nm-settings-ifcfg-rh.xml
endif
include $(top_srcdir)/gtk-doc.make
# workaround setup-build.stamp from gtk-doc.make, which copies
# the file as read-only. That breaks later build steps, as the
# file can no longer be written. Instead, copy the file with `cp -f`
# only.
setup-build.stamp:
-$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \
if test "x$$files" != "x" ; then \
for file in $$files ; do \
destdir=`dirname $(abs_builddir)/$$file`; \
test -d "$$destdir" || mkdir -p "$$destdir"; \
test -f $(abs_srcdir)/$$file && \
( cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file ; \
chmod u+w $(abs_builddir)/$$file ) || true; \
done; \
fi; \
fi
$(AM_V_at)touch setup-build.stamp
settings-spec.xml: settings-spec.xsl $(top_builddir)/man/nm-settings-docs-dbus.xml
$(AM_V_GEN) (! test -f $@ || chmod u+w $@) && xsltproc --output $@ $^
EXTRA_DIST += \
version.xml.in \
settings-spec.xsl \
meson.build \
$(GENERATED_FILES) \
$(NULL)
CLEANFILES += \
html/* \
tmpl/* \
xml/* \
NetworkManager-overrides.txt \
NetworkManager-sections.txt \
NetworkManager.actions \
settings-spec.xml \
$(NULL)

View File

@@ -1,6 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if enable_introspection
xsltproc = find_program('xsltproc')
settings = 'settings-spec'
output = settings + '.xml'

View File

@@ -186,6 +186,7 @@
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Hsr.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.IPTunnel.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Infiniband.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Ipvlan.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Loopback.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Lowpan.xml"/>
<xi:include href="dbus-org.freedesktop.NetworkManager.Device.Macsec.xml"/>

View File

@@ -304,8 +304,8 @@ Note that the unmanaged flags are tracked via two variables
practice a tri-state variable with possible values TRUE (unmanaged),
FALSE (managed) and UNSET.
External devices and sys-iface-state
------------------------------------
External devices and managed-type
---------------------------------
Even if a device is managed, that doesn't mean that NetworkManager is
actively configuring it. When a device is created externally (for
@@ -314,9 +314,9 @@ creates a in-memory connection representing the configuration
parameters on the interface such as IP addresses, routes, DNS, etc.;
the connection appears as active but NetworkManager doesn't actually
touch the interface. The external status is tracked in the
`sys-iface-state` member, which can have the following values:
`managed-type` member, which can have the following values:
- EXTERNAL: the interface is not touched by NM.
- ASSUME: this value is deprecated; it used to mean that NM should manage the device without fully reconfiguring it. Now, the interface is either managed on external.
- MANAGED: the interface is fully managed.
- FULL: the interface is fully managed.
- REMOVED: the link was removed externally.

View File

@@ -0,0 +1,252 @@
<mxfile host="app.diagrams.net" modified="2024-06-28T11:22:13.361Z" agent="Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0" etag="l2Af_3rD5dQLdPzdT-Eh" version="24.4.13" type="device">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1060" dy="533" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-2" value="" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-6" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="220" y="120" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-4" value="Yes" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-6" edge="1">
<mxGeometry y="20" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="220" y="290" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-5" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-7" edge="1">
<mxGeometry y="10" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="270" y="210" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-8" value="No" style="rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;edgeStyle=orthogonalEdgeStyle;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-10" edge="1">
<mxGeometry x="0.3333" y="20" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="220" y="430" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-9" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;jettySize=auto;orthogonalLoop=1;fontSize=11;endArrow=block;endFill=0;endSize=8;strokeWidth=1;shadow=0;labelBackgroundColor=none;" parent="WIyWlLk6GJQsqaUBKTNV-1" target="WIyWlLk6GJQsqaUBKTNV-12" edge="1">
<mxGeometry y="10" relative="1" as="geometry">
<mxPoint as="offset" />
<mxPoint x="270" y="330" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-0" target="SsSxIaJ2XBONRL21woKM-13">
<mxGeometry relative="1" as="geometry">
<mxPoint x="440" y="120" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-0" value="&lt;div style=&quot;&quot;&gt;&lt;font style=&quot;font-size: 12px;&quot;&gt;Static hostname&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;&quot;&gt;&lt;font style=&quot;font-size: 12px;&quot;&gt;set?&lt;/font&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="110" y="187" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-4" target="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-4" value="Build a sorted list of devices eligible for hostname evaluation" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="78.75" y="252" width="182.5" height="38" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-5" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-0" target="SsSxIaJ2XBONRL21woKM-4">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="390" y="360" as="sourcePoint" />
<mxPoint x="440" y="310" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-36" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-8" target="SsSxIaJ2XBONRL21woKM-34">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-8" value="For each device in the list" style="swimlane;whiteSpace=wrap;html=1;strokeWidth=2;strokeColor=#7EA6E0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="77.5" y="308" width="185" height="250" as="geometry">
<mxRectangle x="85" y="320" width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-24" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8" source="SsSxIaJ2XBONRL21woKM-12" target="SsSxIaJ2XBONRL21woKM-23">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-12" value="&lt;div&gt;Got a hostname&lt;/div&gt;&lt;div&gt;from DHCP?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="32.5" y="50" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-15" value="&lt;div&gt;Got a hostname&lt;/div&gt;&lt;div&gt;from DNS?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="32.5" y="180" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-19" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="91.57999999999998" y="30" as="sourcePoint" />
<mxPoint x="91.57999999999998" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-21" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="92.58" y="220" as="sourcePoint" />
<mxPoint x="62.5" y="227" as="targetPoint" />
<Array as="points">
<mxPoint x="92.5" y="240" />
<mxPoint x="62.5" y="240" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8" source="SsSxIaJ2XBONRL21woKM-23" target="SsSxIaJ2XBONRL21woKM-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-23" value="Resolve via DNS" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="32.5" y="115" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-29" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="141.5" y="48" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-28" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="140.5" y="179" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-32" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="85.5" y="214" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-31" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-8">
<mxGeometry x="86.5" y="84" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-89" value="" style="endArrow=none;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-8" source="SsSxIaJ2XBONRL21woKM-15">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="152.5" y="202" as="sourcePoint" />
<mxPoint x="197.5" y="200" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-41" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-13" target="SsSxIaJ2XBONRL21woKM-42">
<mxGeometry relative="1" as="geometry">
<mxPoint x="355" y="500" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-13" value="Use it" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="320" y="437" width="70" height="35" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-12" target="SsSxIaJ2XBONRL21woKM-13">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="275" y="378" />
<mxPoint x="275" y="455" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-26" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="60" y="200" as="sourcePoint" />
<mxPoint x="109.99999999999999" y="206.58" as="targetPoint" />
<Array as="points">
<mxPoint x="60" y="207" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-27" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="219" y="184" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-30" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="164" y="222" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-34" target="SsSxIaJ2XBONRL21woKM-13">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="275" y="594" />
<mxPoint x="275" y="455" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-34" value="Hostname set externally?" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="110" y="574" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-40" value="Start" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="33" y="175" width="50" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-42" value="End" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="335" y="621" width="40" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-43" value="Resolve via DNS" style="swimlane;whiteSpace=wrap;html=1;strokeWidth=2;strokeColor=#7EA6E0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="414" y="230" width="360" height="355" as="geometry">
<mxRectangle x="85" y="320" width="120" height="30" as="alternateBounds" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-60" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-45" target="SsSxIaJ2XBONRL21woKM-57">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-65" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-45" target="SsSxIaJ2XBONRL21woKM-59">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-45" value="&lt;div&gt;systemd-resolved&lt;/div&gt;&lt;div&gt;available?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="20" y="50" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-47" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="79.57999999999998" y="30" as="sourcePoint" />
<mxPoint x="79.57999999999998" y="50" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-61" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-57" target="SsSxIaJ2XBONRL21woKM-58">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-57" value="Resolve via systemd-resolved" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="234" y="52.5" width="100" height="35" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-63" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-58" target="SsSxIaJ2XBONRL21woKM-62">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-66" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-58" target="SsSxIaJ2XBONRL21woKM-59">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-58" value="&lt;div&gt;systemd-resolved&lt;/div&gt;&lt;div&gt;replied?&lt;br&gt;&lt;/div&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="224" y="129.5" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-59" value="&lt;div&gt;spawn helper (dns, files)&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="30" y="129" width="100" height="41" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-75" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-62" target="SsSxIaJ2XBONRL21woKM-70">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-62" value="returned a result?" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="224" y="210" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-67" value="return the result" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="20" y="310" width="330" height="35" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-68" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.801;entryY=0.01;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-62" target="SsSxIaJ2XBONRL21woKM-67">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-70" value="&lt;div&gt;spawn helper (files)&lt;br&gt;&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="SsSxIaJ2XBONRL21woKM-43">
<mxGeometry x="90" y="210" width="100" height="41" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-72" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.104;entryY=0.01;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-59" target="SsSxIaJ2XBONRL21woKM-67">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-74" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="SsSxIaJ2XBONRL21woKM-43" source="SsSxIaJ2XBONRL21woKM-70">
<mxGeometry relative="1" as="geometry">
<mxPoint x="140" y="310" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-76" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="488" y="316" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-77" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="544" y="277" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-78" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="615" y="357" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-81" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="691" y="395" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-82" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="692" y="476" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-83" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="617" y="438" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-85" value="Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="219" y="571" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-87" value="N" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="164" y="608" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="SsSxIaJ2XBONRL21woKM-88" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.007;entryY=0.452;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="SsSxIaJ2XBONRL21woKM-34" target="SsSxIaJ2XBONRL21woKM-42">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

40
docs/internal/hostname.md Normal file
View File

@@ -0,0 +1,40 @@
Hostname management
===================
NetworkManager can update the system hostname via different
mechanisms. The following diagram describes the workflow:
![Hostname management workflow](hostname.png "Hostname management")
A few notes on the diagram:
- if there is a static hostname set in `/etc/hostname`, no action is
taken. NetworkManager only manages the transient hostname. See the
systemd-hostnamed
[documentation](https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.hostname1.html#Semantics)
about the distinction between static and transient hostname.
- When there is no static hostname set, NetworkManager builds a
sorted list of active devices that are eligible for the hostname
evaluation. When doing so, the `hostname` setting of the connection
active on each device is taken into account. Properties `from-dhcp`
and `from-dns-lookup` determine if the two methods must be used for
the device; property `only-from-default` determines whether devices
without a default route should be considered, and `priority` is
used to sort the entries. In case of a tie of the priority, a
device with the default route comes first.
- When evaluating a given device, first NM checks if the device
received an hostname via DHCP and then if the first IPv4 and IPv6
addresses configured on the interface can be resolved to a name via
DNS. The mechanism used to perform the reverse DNS lookup of a
specific address is described in the diagram on the right.
- In the "spawn helper" step, NM starts a separate process that
performs the reverse DNS lookup using the NSS services specified
(see `man nsswitch.conf`). Service `dns` does the lookup via a DNS
query, while `files` returns results from `/etc/hosts`.
- In case there is no valid result from DHCP or DNS, from any device,
if there a valid transient hostname set outside of NetworkManager,
that hostname is honored.

BIN
docs/internal/hostname.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@@ -1,117 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.6
check_local =
# The name of the module
DOC_MODULE=libnm
# The top-level SGML file.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting functions and macros.
DOC_SOURCE_DIR= \
$(top_builddir)/src/libnm-core-public \
$(top_srcdir)/src/libnm-core-public \
$(top_builddir)/src/libnm-core-impl \
$(top_srcdir)/src/libnm-core-impl \
$(top_srcdir)/src/libnm-client-public \
$(top_builddir)/src/libnm-client-public \
$(top_srcdir)/src/libnm-client-impl \
$(top_builddir)/src/libnm-client-impl \
$(NULL)
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS=--rebuild-types --rebuild-sections --ignore-decorators='NM_AVAILABLE_IN_\d+_\d+|NM_DEPRECATED_IN_\d+_\d+|NM_DEPRECATED_IN_\d+_\d+_FOR\(\)'
# Extra options to supply to gtkdoc-mkdb.
MKDB_OPTIONS=--sgml-mode --output-format=xml
# Extra options to supply to gtkdoc-fixref.
FIXXREF_OPTIONS=
# Used for dependencies.
HFILE_GLOB=$(top_srcdir)/src/libnm-core-public/*.h $(top_srcdir)/src/libnm-client-public/*.h
CFILE_GLOB=$(top_srcdir)/src/libnm-core-impl/*.c $(top_srcdir)/src/libnm-client-impl/*.c
# Header files to ignore when scanning.
IGNORE_HFILES= \
nm-dbus-helpers.h \
nm-default-libnm.h \
nm-device-private.h \
nm-dhcp4-config.h \
nm-dhcp6-config.h \
nm-dns-manager.h \
nm-ip4-config.h \
nm-ip6-config.h \
nm-libnm-utils.h \
nm-object-private.h \
nm-remote-connection-private.h \
\
nm-connection-private.h \
nm-default-libnm-core.h \
nm-setting-private.h \
nm-team-utils.h \
nm-utils-private.h \
\
nm-core-tests-enum-types.h \
test-general-enums.h \
\
$(NULL)
# Images to copy into HTML directory.
HTML_IMAGES = libnm.png
# Extra XML files that are included by $(DOC_MAIN_SGML_FILE).
content_files = version.xml
# Other files to distribute.
extra_files = libnm.png
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
GTKDOC_CFLAGS = \
-I$(top_builddir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-core-public \
-I$(top_srcdir)/src/libnm-client-public \
-I$(top_builddir)/src/libnm-client-public \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS) \
$(SANITIZER_EXEC_CFLAGS)
GTKDOC_LIBS = \
$(top_builddir)/src/libnm-client-impl/libnm.la \
$(GLIB_LIBS) \
$(SANITIZER_EXEC_LDFLAGS)
# include common portion ...
include $(top_srcdir)/gtk-doc.make
EXTRA_DIST += \
version.xml.in \
meson.build \
$(NULL)
CLEANFILES += \
html/* \
tmpl/* \
xml/* \
libnm-overrides.txt \
libnm-sections.txt \
libnm.actions \
$(NULL)
if GTK_DOC_BUILD_HTML
check-local-gtk-doc-patch:
@if grep -q -F '<a href="libnm-nm-setting-user.html">nm-setting-user</a>' "$(top_builddir)/docs/libnm/html/index.html"; then \
echo "WARNING: The generated documentation has issues. Patch your gtk-doc (see https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2). Let this check fail with NMTST_CHECK_GTK_DOC=1"; \
test "$$NMTST_CHECK_GTK_DOC" != 1; \
fi
check_local += check-local-gtk-doc-patch
endif
check-local: $(check_local)

View File

@@ -325,6 +325,7 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in
<xi:include href="xml/nm-setting-ip-tunnel.xml"/>
<xi:include href="xml/nm-setting-ip4-config.xml"/>
<xi:include href="xml/nm-setting-ip6-config.xml"/>
<xi:include href="xml/nm-setting-ipvlan.xml"/>
<xi:include href="xml/nm-setting-link.xml"/>
<xi:include href="xml/nm-setting-loopback.xml"/>
<xi:include href="xml/nm-setting-macsec.xml"/>
@@ -340,6 +341,7 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in
<xi:include href="xml/nm-setting-ovs-port.xml"/>
<xi:include href="xml/nm-setting-ppp.xml"/>
<xi:include href="xml/nm-setting-pppoe.xml"/>
<xi:include href="xml/nm-setting-prefix-delegation.xml"/>
<xi:include href="xml/nm-setting-proxy.xml"/>
<xi:include href="xml/nm-setting-serial.xml"/>
<xi:include href="xml/nm-setting-sriov.xml"/>
@@ -378,6 +380,7 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in
<xi:include href="xml/nm-device-hsr.xml"/>
<xi:include href="xml/nm-device-infiniband.xml"/>
<xi:include href="xml/nm-device-ip-tunnel.xml"/>
<xi:include href="xml/nm-device-ipvlan.xml"/>
<xi:include href="xml/nm-device-loopback.xml"/>
<xi:include href="xml/nm-device-macsec.xml"/>
<xi:include href="xml/nm-device-macvlan.xml"/>

View File

@@ -107,7 +107,7 @@ connection_add(NMConnection *conn)
nm_connection_get_id(conn),
nm_connection_get_uuid(conn));
rdata = (RequestData){
rdata = (RequestData) {
.loop = g_main_loop_new(NULL, FALSE),
.rconn = NULL,
.error = NULL,

View File

@@ -35,7 +35,7 @@ def show_addresses(dev, family):
addr = nm_address.get_address()
prefix = nm_address.get_prefix()
print("%s/%d") % (addr, prefix)
print("%s/%d" % (addr, prefix))
def show_gateway(dev, family):
@@ -75,7 +75,7 @@ def show_routes(dev, family):
next_hop = nm_route.get_next_hop()
metric = nm_route.get_metric()
print("%s/%d %s %d") % (dest, prefix, next_hop, metric)
print("%s/%d %s %d" % (dest, prefix, next_hop, metric))
def show_dns(dev, family):
@@ -88,11 +88,11 @@ def show_dns(dev, family):
print("None")
return
print("Nameservers: %s") % (ip_cfg.get_nameservers())
print("Domains: %s") % (ip_cfg.get_domains())
print("Searches: %s") % (ip_cfg.get_searches())
print("Nameservers: %s" % ip_cfg.get_nameservers())
print("Domains: %s" % ip_cfg.get_domains())
print("Searches: %s" % ip_cfg.get_searches())
if family == socket.AF_INET:
print("WINS: %s") % (ip_cfg.get_wins_servers())
print("WINS: %s" % ip_cfg.get_wins_servers())
if __name__ == "__main__":
@@ -110,39 +110,39 @@ if __name__ == "__main__":
print("IPv4 addresses:")
print("---------------")
show_addresses(dev, socket.AF_INET)
print
print()
print("IPv4 gateway:")
print("-------------")
show_gateway(dev, socket.AF_INET)
print
print()
print("IPv4 routes:")
print("------------")
show_routes(dev, socket.AF_INET)
print
print()
print("IPv6 addresses:")
print("---------------")
show_addresses(dev, socket.AF_INET6)
print
print()
print("IPv6 gateway:")
print("-------------")
show_gateway(dev, socket.AF_INET6)
print
print()
print("IPv6 routes:")
print("------------")
show_routes(dev, socket.AF_INET6)
print
print()
print("IPv4 DNS:")
print("------------")
show_dns(dev, socket.AF_INET)
print
print()
print("IPv6 DNS:")
print("------------")
show_dns(dev, socket.AF_INET6)
print
print()

View File

@@ -14,7 +14,7 @@
# API (like NM.Client.new()) is for simple programs but usually not best
# for using NMClient for real applications.
#
# To learn more about GMainContext, read https://developer.gnome.org/SearchProvider/documentation/tutorials/main-contexts.html
# To learn more about GMainContext, read https://developer.gnome.org/documentation/tutorials/main-contexts.html
# When I say "mainloop" or "event loop", I mean GMainContext. GMainLoop is
# a small wrapper around GMainContext to run the context with a boolean
# flag.
@@ -188,7 +188,7 @@ def create_nmc(dbus_connection):
# which has an overhead.
#
# Also, split the GObject creation and the init_async() call in two.
# That allows to pass construct-only parameters, in particular like
# That allows one to pass construct-only parameters, in particular like
# the instance_flags.
# Create a separate context for the NMClient. The NMClient is strongly

View File

@@ -0,0 +1,92 @@
#!/usr/bin/env python
# SPDX-License-Identifier: LGPL-2.1-or-later
import gi
gi.require_version("NM", "1.0")
from gi.repository import GLib, NM, Gio
# This example shows how to implement a very simple secret agent for
# NetworkManager. The secret agent registers to the NM daemon and can
# provide missing secrets like Wi-Fi or VPN passwords. Set environment
# variable "LIBNM_CLIENT_DEBUG=trace" to enable libnm verbose logging.
class SecretAgent(NM.SecretAgentOld):
def __init__(self):
super().__init__(identifier="MySecretAgent")
super().init()
def do_get_secrets(
self,
connection,
connection_path,
setting_name,
hints,
flags,
callback,
callback_data,
):
print(
"get_secrets for '{}', interface '{}', setting '{}'".format(
connection.get_id(), connection.get_interface_name(), setting_name
)
)
# Implement here the logic to retrieve the secrets.
# As an example, we return a hardcoded Wi-Fi PSK.
if (
connection.get_connection_type() == "802-11-wireless"
and setting_name == "802-11-wireless-security"
):
s_wifi = connection.get_setting_wireless()
ssid = NM.utils_ssid_to_utf8(s_wifi.get_ssid().get_data())
if ssid == "home":
secrets = GLib.Variant(
"a{sa{sv}}",
{
"802-11-wireless-security": {
"psk": GLib.Variant("s", "abcd1234")
}
},
)
print("Sending secrets {}".format(secrets))
callback(self, connection, secrets, None)
return
# We don't have the secret, NM will ask to another agent or fail
callback(
self,
connection,
None,
GLib.GError.new_literal(
NM.SecretAgentError.quark(),
"No secrets found",
NM.SecretAgentError.NOSECRETS,
),
)
def do_cancel_get_secrets(self, connection_path, connection_name):
pass
def do_save_secrets(self, connection, connection_path, callback, callback_data):
# Implement this if you want to store "agent-owned" secrets
callback(self, connection, None)
def do_delete_secrets(self, connection, connection_path, callback, callback_data):
# Implement this if you want to store "agent-owned" secrets
callback(self, connection, None)
def main():
agent = SecretAgent()
loop = GLib.MainLoop()
try:
loop.run()
except KeyboardInterrupt:
print("Exiting Secret Agent...")
if __name__ == "__main__":
main()

View File

@@ -42,33 +42,32 @@ if __name__ == "__main__":
# create Client object
client = NM.Client.new(None)
all_connections = client.get_connections()
for c in all_connections:
if c.get_uuid() != uuid:
continue
try:
conn = next(c for c in client.get_connections() if c.get_uuid() == uuid)
except StopIteration:
sys.exit("not found connection with uuid=%s" % uuid)
# add IPv4 setting if it doesn't yet exist
s_ip4 = c.get_setting_ip4_config()
if not s_ip4:
s_ip4 = NM.SettingIP4Config.new()
c.add_setting(s_ip4)
# add IPv4 setting if it doesn't yet exist
s_ip4 = conn.get_setting_ip4_config()
if not s_ip4:
s_ip4 = NM.SettingIP4Config.new()
conn.add_setting(s_ip4)
# set the method and change properties
s_ip4.set_property(NM.SETTING_IP_CONFIG_METHOD, method)
if method == "auto":
# remove addresses and gateway
s_ip4.clear_addresses()
s_ip4.props.gateway = None
elif method == "manual":
# Add the static IP address, prefix, and (optional) gateway
addr = NM.IPAddress.new(socket.AF_INET, sys.argv[3], int(sys.argv[4]))
s_ip4.add_address(addr)
if len(sys.argv) == 6:
s_ip4.props.gateway = sys.argv[5]
# set the method and change properties
s_ip4.set_property(NM.SETTING_IP_CONFIG_METHOD, method)
if method == "auto":
# remove addresses and gateway
s_ip4.clear_addresses()
s_ip4.props.gateway = None
elif method == "manual":
# Add the static IP address, prefix, and (optional) gateway
addr = NM.IPAddress.new(socket.AF_INET, sys.argv[3], int(sys.argv[4]))
s_ip4.add_address(addr)
if len(sys.argv) == 6:
s_ip4.props.gateway = sys.argv[5]
try:
c.commit_changes(True, None)
print("The connection profile has been updated.")
except Exception as e:
sys.stderr.write("Error: %s\n" % e)
break
try:
conn.commit_changes(True, None)
print("The connection profile has been updated.")
except Exception as e:
sys.stderr.write("Error: %s\n" % e)

View File

@@ -18,6 +18,7 @@ ifaces = [
'org.freedesktop.NetworkManager.Device.Hsr',
'org.freedesktop.NetworkManager.Device.IPTunnel',
'org.freedesktop.NetworkManager.Device.Infiniband',
'org.freedesktop.NetworkManager.Device.Ipvlan',
'org.freedesktop.NetworkManager.Device.Loopback',
'org.freedesktop.NetworkManager.Device.Lowpan',
'org.freedesktop.NetworkManager.Device.Macsec',

View File

@@ -9,7 +9,7 @@
<!--
Port1:
@since: 1.46
@since: 1.46
The device's port1 device.
-->
@@ -17,7 +17,7 @@
<!--
Port2:
@since: 1.46
@since: 1.46
The device's port2 device.
-->
@@ -25,7 +25,7 @@
<!--
SupervisionAddress:
@since: 1.46
@since: 1.46
The supervision MAC address.
-->
@@ -33,7 +33,7 @@
<!--
MulticastSpec:
@since: 1.46
@since: 1.46
The last byte of the supervision address.
-->
@@ -41,7 +41,7 @@
<!--
Prp:
@since: 1.46
@since: 1.46
Whether the PRP protocol is used or not.
-->

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<node name="/">
<!--
org.freedesktop.NetworkManager.Device.Ipvlan:
@short_description: IPVLAN Device.
-->
<interface name="org.freedesktop.NetworkManager.Device.Ipvlan">
<!--
Parent:
@since: 1.52
The object path of the parent device.
-->
<property name="Parent" type="o" access="read"/>
<!--
Vepa:
@since: 1.52
The IPVLAN VEPA flag.
-->
<property name="Vepa" type="b" access="read"/>
<!--
Mode:
@since: 1.52
The IPVLAN mode, one of "l2", "l3", "l3s".
-->
<property name="Mode" type="s" access="read"/>
<!--
Private:
@since: 1.52
The IPVLAN private flag.
-->
<property name="Private" type="b" access="read"/>
</interface>
</node>

View File

@@ -321,7 +321,7 @@
<!--
Reapply:
@connection: The optional connection settings that will be reapplied on the device. If empty, the currently active settings-connection will be used. The connection cannot arbitrarily differ from the current applied-connection otherwise the call will fail. Only certain changes are supported, like adding or removing IP addresses.
@version_id: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows to catch concurrent modifications between the GetAppliedConnection call and Reapply.
@version_id: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows one to catch concurrent modifications between the GetAppliedConnection call and Reapply.
@flags: Flags which would modify the behavior of the Reapply call. Invalid flags are rejected.
Attempts to update the configuration of a device without deactivating it.
@@ -337,7 +337,7 @@
settings-connection, or call Reapply. The Reapply call allows you to
directly update the applied-connection and reconfigure the device. Reapply
can also be useful if the currently applied-connection is equal to the
connection that is about to be reapplied. This allows to reconfigure the
connection that is about to be reapplied. This allows one to reconfigure the
device and revert external changes like removing or adding an IP address
(which NetworkManager doesn't revert automatically because it is assumed
that the user made these changes intentionally outside of NetworkManager).

View File

@@ -1,290 +0,0 @@
dnl Macros to check the presence of generic (non-typed) symbols.
dnl Copyright (c) 2006-2008 Diego Pettenò <flameeyes@gmail.com>
dnl Copyright (c) 2006-2008 xine project
dnl Copyright (c) 2012 Lucas De Marchi <lucas.de.marchi@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program.
dnl
dnl As a special exception, the copyright owners of the
dnl macro gives unlimited permission to copy, distribute and modify the
dnl configure scripts that are the output of Autoconf when processing the
dnl Macro. You need not follow the terms of the GNU General Public
dnl License when using or distributing such scripts, even though portions
dnl of the text of the Macro appear in them. The GNU General Public
dnl License (GPL) does govern all other use of the material that
dnl constitutes the Autoconf Macro.
dnl
dnl This special exception to the GPL applies to versions of the
dnl Autoconf Macro released by this project. When you make and
dnl distribute a modified version of the Autoconf Macro, you may extend
dnl this special exception to the GPL to apply to your modified version as
dnl well.
dnl Check if FLAG in ENV-VAR is supported by compiler and append it
dnl to WHERE-TO-APPEND variable. Note that we invert -Wno-* checks to
dnl -W* as gcc cannot test for negated warnings. If a C snippet is passed,
dnl use it, otherwise use a simple main() definition that just returns 0.
dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG], [C-SNIPPET])
AC_DEFUN([CC_CHECK_FLAG_APPEND], [
AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
AS_TR_SH([cc_cv_$2_$3]),
[eval "AS_TR_SH([cc_save_$2])='${$2}'"
eval "AS_TR_SH([$2])='${cc_save_$2} -Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
AC_LINK_IFELSE([AC_LANG_SOURCE(ifelse([$4], [],
[int main(void) { return 0; } ],
[$4]))],
[eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
[eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
eval "AS_TR_SH([$2])='$cc_save_$2'"])
AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],
[eval "$1='${$1} $3'"])
])
dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2], [C-SNIPPET])
AC_DEFUN([CC_CHECK_FLAGS_APPEND], [
for flag in [$3]; do
CC_CHECK_FLAG_APPEND([$1], [$2], $flag, [$4])
done
])
dnl Check if the flag is supported by linker (cacheable)
dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
AC_DEFUN([CC_CHECK_LDFLAGS], [
AC_CACHE_CHECK([if $CC supports $1 flag],
AS_TR_SH([cc_cv_ldflags_$1]),
[ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $1"
AC_LINK_IFELSE([int main() { return 1; }],
[eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
[eval "AS_TR_SH([cc_cv_ldflags_$1])="])
LDFLAGS="$ac_save_LDFLAGS"
])
AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],
[$2], [$3])
])
dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for
dnl the current linker to avoid undefined references in a shared object.
AC_DEFUN([CC_NOUNDEFINED], [
dnl We check $host for which systems to enable this for.
AC_REQUIRE([AC_CANONICAL_HOST])
case $host in
dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
dnl are requested, as different implementations are present; to avoid problems
dnl use -Wl,-z,defs only for those platform not behaving this way.
*-freebsd* | *-openbsd*) ;;
*)
dnl First of all check for the --no-undefined variant of GNU ld. This allows
dnl for a much more readable command line, so that people can understand what
dnl it does without going to look for what the heck -z defs does.
for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do
CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"])
break
done
;;
esac
AC_SUBST([LDFLAGS_NOUNDEFINED])
])
dnl Check for a -Werror flag or equivalent. -Werror is the GCC
dnl and ICC flag that tells the compiler to treat all the warnings
dnl as fatal. We usually need this option to make sure that some
dnl constructs (like attributes) are not simply ignored.
dnl
dnl Other compilers don't support -Werror per se, but they support
dnl an equivalent flag:
dnl - Sun Studio compiler supports -errwarn=%all
AC_DEFUN([CC_CHECK_WERROR], [
AC_CACHE_CHECK(
[for $CC way to treat warnings as errors],
[cc_cv_werror],
[CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror],
[CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])])
])
])
AC_DEFUN([CC_CHECK_ATTRIBUTE], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))],
AS_TR_SH([cc_cv_attribute_$1]),
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])],
[eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"],
[eval "AS_TR_SH([cc_cv_attribute_$1])='no'"])
CFLAGS="$ac_save_CFLAGS"
])
AS_IF([eval test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes],
[AC_DEFINE(
AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1,
[Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))]
)
$4],
[$5])
])
AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
CC_CHECK_ATTRIBUTE(
[constructor],,
[void __attribute__((constructor)) ctor() { int a; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
CC_CHECK_ATTRIBUTE(
[format], [format(printf, n, n)],
[void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [
CC_CHECK_ATTRIBUTE(
[format_arg], [format_arg(printf)],
[char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
CC_CHECK_ATTRIBUTE(
[visibility_$1], [visibility("$1")],
[void __attribute__((visibility("$1"))) $1_function() { }],
[$2], [$3])
])
AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
CC_CHECK_ATTRIBUTE(
[nonnull], [nonnull()],
[void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
CC_CHECK_ATTRIBUTE(
[unused], ,
[void some_function(void *foo, __attribute__((unused)) void *bar);],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [
CC_CHECK_ATTRIBUTE(
[sentinel], ,
[void some_function(void *foo, ...) __attribute__((sentinel));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [
CC_CHECK_ATTRIBUTE(
[deprecated], ,
[void some_function(void *foo, ...) __attribute__((deprecated));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_ALIAS], [
CC_CHECK_ATTRIBUTE(
[alias], [weak, alias],
[void other_function(void *foo) { }
void some_function(void *foo) __attribute__((weak, alias("other_function")));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_MALLOC], [
CC_CHECK_ATTRIBUTE(
[malloc], ,
[void * __attribute__((malloc)) my_alloc(int n);],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_PACKED], [
CC_CHECK_ATTRIBUTE(
[packed], ,
[struct astructure { char a; int b; long c; void *d; } __attribute__((packed));],
[$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_CONST], [
CC_CHECK_ATTRIBUTE(
[const], ,
[int __attribute__((const)) twopow(int n) { return 1 << n; } ],
[$1], [$2])
])
AC_DEFUN([CC_FLAG_VISIBILITY], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],
[cc_cv_flag_visibility],
[cc_flag_visibility_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden],
cc_cv_flag_visibility='yes',
cc_cv_flag_visibility='no')
CFLAGS="$cc_flag_visibility_save_CFLAGS"])
AS_IF([test "x$cc_cv_flag_visibility" = "xyes"],
[AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
[Define this if the compiler supports the -fvisibility flag])
$1],
[$2])
])
AC_DEFUN([CC_FUNC_EXPECT], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([if compiler has __builtin_expect function],
[cc_cv_func_expect],
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[int some_function() {
int a = 3;
return (int)__builtin_expect(a, 3);
}])],
[cc_cv_func_expect=yes],
[cc_cv_func_expect=no])
CFLAGS="$ac_save_CFLAGS"
])
AS_IF([test "x$cc_cv_func_expect" = "xyes"],
[AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1,
[Define this if the compiler supports __builtin_expect() function])
$1],
[$2])
])
AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([highest __attribute__ ((aligned ())) supported],
[cc_cv_attribute_aligned],
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $cc_cv_werror"
for cc_attribute_align_try in 64 32 16 8 4 2; do
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
int main() {
static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0;
return c;
}])], [cc_cv_attribute_aligned=$cc_attribute_align_try; break])
done
CFLAGS="$ac_save_CFLAGS"
])
if test "x$cc_cv_attribute_aligned" != "x"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], [$cc_cv_attribute_aligned],
[Define the highest alignment supported])
fi
])

View File

@@ -1,158 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_LIB_READLINE
#
# DESCRIPTION
#
# Searches for a readline compatible library. If found, defines
# `HAVE_LIBREADLINE'. If the found library has the `add_history' function,
# sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the
# necessary include files and sets `HAVE_READLINE_H' or
# `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
# 'HAVE_HISTORY_H' if the corresponding include files exists.
#
# The libraries that may be readline compatible are `libedit',
# `libeditline' and `libreadline'. Sometimes we need to link a termcap
# library for readline to work, this macro tests these cases too by trying
# to link with `libtermcap', `libcurses' or `libncurses' before giving up.
#
# Here is an example of how to use the information provided by this macro
# to perform the necessary includes or declarations in a C file:
#
# #ifdef HAVE_LIBREADLINE
# # if defined(HAVE_READLINE_READLINE_H)
# # include <readline/readline.h>
# # elif defined(HAVE_READLINE_H)
# # include <readline.h>
# # else /* !defined(HAVE_READLINE_H) */
# extern char *readline ();
# # endif /* !defined(HAVE_READLINE_H) */
# char *cmdline = NULL;
# #else /* !defined(HAVE_READLINE_READLINE_H) */
# /* no readline */
# #endif /* HAVE_LIBREADLINE */
#
# #ifdef HAVE_READLINE_HISTORY
# # if defined(HAVE_READLINE_HISTORY_H)
# # include <readline/history.h>
# # elif defined(HAVE_HISTORY_H)
# # include <history.h>
# # else /* !defined(HAVE_HISTORY_H) */
# extern void add_history ();
# extern int write_history ();
# extern int read_history ();
# # endif /* defined(HAVE_READLINE_HISTORY_H) */
# /* no history */
# #endif /* HAVE_READLINE_HISTORY */
#
# LICENSE
#
# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
AC_DEFUN([AX_LIB_READLINE], [
AC_ARG_WITH(readline,
AS_HELP_STRING([--with-readline=auto|libreadline|libedit|none], [Using libreadline (auto) or libedit]),
[],
[with_readline=auto])
if test "$with_readline" != "none"; then
AC_CACHE_CHECK([for a readline compatible library],
ax_cv_lib_readline, [
ORIG_LIBS="$LIBS"
if test "$with_readline" = "libreadline"; then
search_readlines="readline"
elif test "$with_readline" = "libedit"; then
search_readlines="edit"
elif test "$with_readline" = "auto"; then
search_readlines="readline edit"
else
AC_MSG_ERROR([invalid --with-readline option. Valid options are --with-readline=auto|libreadline|libedit|none])
fi
for readline_lib in $search_readlines; do
# prefer ncurses since we use it for nmtui too
for termcap_lib in "" termcap curses ncurses; do
if test -z "$termcap_lib"; then
TRY_LIB="-l$readline_lib"
else
TRY_LIB="-l$readline_lib -l$termcap_lib"
fi
LIBS="$ORIG_LIBS $TRY_LIB"
AC_LINK_IFELSE([AC_LANG_CALL([], [readline])], [ax_cv_lib_readline="$TRY_LIB"])
if test -n "$ax_cv_lib_readline"; then
break
fi
done
if test -n "$ax_cv_lib_readline"; then
if test "$with_readline" = auto; then
if test "$readline_lib" = readline; then
with_readline=libreadline
else
with_readline=libedit
fi
fi
break
fi
done
if test -z "$ax_cv_lib_readline"; then
if test "$with_readline" != auto; then
AC_MSG_ERROR([libreadline not found for --with-readline=$with_readline"])
fi
with_readline=none
ax_cv_lib_readline="no"
fi
LIBS="$ORIG_LIBS"
])
if test "$ax_cv_lib_readline" != "no"; then
READLINE_LIBS="$ax_cv_lib_readline"
AC_SUBST(READLINE_LIBS)
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have a readline compatible library])
if test "$with_readline" = "libedit"; then
AC_DEFINE(HAVE_EDITLINE_READLINE, 1,
[Explicitly set to 1 when libedit shall be used])
else
AC_DEFINE(HAVE_EDITLINE_READLINE, 0,
[By default the libreadline is used as readline library])
fi
ORIG_LIBS="$LIBS"
LIBS="$ORIG_LIBS $ax_cv_lib_readline"
AC_CACHE_CHECK([whether readline supports history],
ax_cv_lib_readline_history, [
ax_cv_lib_readline_history="no"
AC_LINK_IFELSE([AC_LANG_CALL([], [history_set_history_state])],
[ax_cv_lib_readline_history="yes"])
])
LIBS=$ORIG_LIBS
if test "$ax_cv_lib_readline_history" = "yes"; then
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
[Define if your readline library has \`history_set_history_state'])
AC_CHECK_HEADERS(readline/history.h histedit.h)
else
AC_DEFINE(HAVE_READLINE_HISTORY, 0,
[Explicitly set to 0 when libreadline shall not be used])
fi
fi
fi
])dnl

View File

@@ -1,522 +0,0 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
# needed for multi-threaded programs (defaults to the value of CC
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
# special cc_r/CC_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
# CXX="$PTHREAD_CXX"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 30
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_TARGET])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on Tru64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
CC="$ax_pthread_save_CC"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items with a "," contain both
# C compiler flags (before ",") and linker flags (after ","). Other items
# starting with a "-" are C compiler flags, and remaining items are
# library names, except for "none" which indicates that we try without
# any flags at all, and "pthread-config" which is a program returning
# the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
# (Note: HP C rejects this with "bad form for `-t' option")
# -pthreads: Solaris/gcc (Note: HP C also rejects)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case $target_os in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (N.B.: The stubs are missing
# pthread_cleanup_push, or rather a function called by this macro,
# so we could check for that, but who knows whether they'll stub
# that too in a future libc.) So we'll check first for the
# standard Solaris way of linking pthreads (-mt -lpthread).
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
;;
esac
# Are we compiling with Clang?
AC_CACHE_CHECK([whether $CC is Clang],
[ax_cv_PTHREAD_CLANG],
[ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
AX_PTHREAD_CC_IS_CLANG
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
# Note that for GCC and Clang -pthread generally implies -lpthread,
# except when -nostdlib is passed.
# This is problematic using libtool to build C++ shared libraries with pthread:
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
# To solve this, first try -pthread together with -lpthread for GCC
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
AS_IF([test "x$ax_pthread_clang" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread"])
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $target_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
*,*)
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
# if $ax_pthread_check_cond
# error "$ax_pthread_check_macro must be defined"
# endif
static void *some_global = NULL;
static void routine(void *a)
{
/* To avoid any unused-parameter or
unused-but-set-parameter warning. */
some_global = a;
}
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
AC_MSG_RESULT([$ax_pthread_ok])
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
# Various other checks:
if test "x$ax_pthread_ok" = "xyes"; then
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_CACHE_CHECK([for joinable pthread attribute],
[ax_cv_PTHREAD_JOINABLE_ATTR],
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $ax_pthread_attr; return attr /* ; */])],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
[])
done
])
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $target_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
])
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
test "x$ax_pthread_special_flags_added" != "xyes"],
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes])
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;
return i;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != "xyes"; then
case $target_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
],
[
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
]
)
])
;;
esac
fi
fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
AC_SUBST([PTHREAD_CXX])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD

View File

@@ -1,227 +0,0 @@
AC_DEFUN([_NM_COMPILER_FLAG], [
CFLAGS_SAVED="$CFLAGS"
CFLAGS="$CFLAGS $GLIB_CFLAGS -Werror $1"
AC_MSG_CHECKING([whether $1 works as expected])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[$2]])], [
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS_SAVED"
$3
],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS_SAVED"
$4
])
],[
AC_MSG_RESULT(not supported)
CFLAGS="$CFLAGS_SAVED"
])
])
dnl Check whether a particular compiler flag is supported,
dnl append it to the specified variable if the check succeeds.
dnl NM_COMPILER_FLAG([ENV-VAR], [FLAG], [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED])
AC_DEFUN([NM_COMPILER_FLAG], [
_NM_COMPILER_FLAG([$2], [], [
eval "AS_TR_SH([$1])='$$1 $2'"
$3
], [$4])
])
dnl Check whether a particular warning is supported. If yes, the flag
dnl is appended to [ENV-VAR].
dnl NM_COMPILER_WARNING_FLAG([ENV-VAR], [WARNING])
AC_DEFUN([NM_COMPILER_WARNING_FLAG], [
dnl "-Wno-*" requires special handling, see https://gcc.gnu.org/wiki/FAQ#wnowarning.
_NM_COMPILER_FLAG([-Wall $(printf '%s' "$2" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [], [eval "AS_TR_SH([$1])='$$1 $2'"], [])
])
dnl Check whether a particular warning is not emitted with code provided,
dnl append an option to disable the warning to a specified variable if the check fails.
dnl Note that this always either adds -W$2 or -Wno-$2, depending on whether it's supported.
dnl NM_COMPILER_WARNING([ENV-VAR], [WARNING], [C-SNIPPET])
AC_DEFUN([NM_COMPILER_WARNING], [
_NM_COMPILER_FLAG([-W$2], [$3], [eval "AS_TR_SH([$1])='$$1 -W$2'"], [eval "AS_TR_SH([$1])='$$1 -Wno-$2'"])
])
dnl NM_COMPILER_WARNINGS([ENV-VAR], [MORE-WARNINGS])
AC_DEFUN([NM_COMPILER_WARNINGS],
[AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
set_more_warnings="$enableval",set_more_warnings=$2)
AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
dnl This is enabled in clang by default, makes little sense,
dnl and causes the build to abort with -Werror.
CFLAGS_SAVED="$CFLAGS"
CFLAGS="$CFLAGS -Qunused-arguments"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], eval "AS_TR_SH([$1])='$$1 -Qunused-arguments'", [])
CFLAGS="$CFLAGS_SAVED"
dnl clang only warns about unknown warnings, unless
dnl called with "-Werror=unknown-warning-option"
dnl Test if the compiler supports that, and if it does
dnl attach it to the CFLAGS.
NM_COMPILER_WARNING([$1], [unknown-warning-option], [])
CFLAGS_MORE_WARNINGS="-Wall"
if test "x$enable_lto" = xyes; then
dnl With LTO and optimizations enabled, gcc 10.2.1-1.fc32 is really
dnl adamant to warn about correct uses of strncpy. Disable "-Wstringop-overflow".
_CFLAGS_MORE_WARNINGS_DISABLE_LTO="-Wno-stringop-overflow"
dnl We want to build with "-Wmaybe-uninitialized" enabled. With LTO that
dnl can easily lead to false positives. For manual testing, disable the
dnl warning here by uncommenting the following line.
dnl _CFLAGS_MORE_WARNINGS_DISABLE_LTO="$_CFLAGS_MORE_WARNINGS_DISABLE_LTO -Wno-error=maybe-uninitialized"
else
_CFLAGS_MORE_WARNINGS_DISABLE_LTO=
fi
if test "x$set_more_warnings" = xerror; then
CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS -Werror"
fi
for option in \
$_CFLAGS_MORE_WARNINGS_DISABLE_LTO \
-Wall \
-Wextra \
-Wcast-align=strict \
-Wdeclaration-after-statement \
-Wfloat-equal \
-Wformat-nonliteral \
-Wformat-security \
-Wimplicit-function-declaration \
-Wimplicit-int \
-Winit-self \
-Wint-conversion \
-Wlogical-op \
-Wmissing-declarations \
-Wmissing-include-dirs \
-Wmissing-prototypes \
-Wold-style-definition \
-Wparentheses-equality \
-Wpointer-arith \
-Wshadow \
-Wshift-negative-value \
-Wstrict-prototypes \
-Wtypedef-redefinition \
-Wundef \
-Wunknown-attributes \
-Wvla \
-Wno-duplicate-decl-specifier \
-Wno-format-truncation \
-Wno-format-y2k \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-missing-field-initializers \
-Wno-pragmas \
-Wno-sign-compare \
-Wno-tautological-constant-out-of-range-compare \
-Wno-unknown-pragmas \
-Wno-unused-parameter \
; do
dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
_NM_COMPILER_FLAG([-Wall $(printf '%s' "$option" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [],
[CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS $option"], [])
done
unset option
dnl Disable warnings triggered by known compiler problems
dnl https://bugzilla.gnome.org/show_bug.cgi?id=745821
NM_COMPILER_WARNING([$1], [unknown-attributes], [#include <glib.h>])
dnl https://bugzilla.gnome.org/show_bug.cgi?id=744473
NM_COMPILER_WARNING([$1], [typedef-redefinition], [#include <gio/gio.h>])
dnl https://llvm.org/bugs/show_bug.cgi?id=21614
NM_COMPILER_WARNING([$1], [array-bounds],
[#include <string.h>]
[void f () { strcmp ("something", "0"); }]
)
dnl https://llvm.org/bugs/show_bug.cgi?id=22949
NM_COMPILER_WARNING([$1], [parentheses-equality],
[#include <sys/wait.h>]
[void f () { if (WIFCONTINUED(0)) return; }]
)
dnl systemd-dhcp's log_internal macro and our handle_warn are sometimes
dnl used in void context,u sometimes in int. Makes clang unhappy.
NM_COMPILER_WARNING([$1], [unused-value],
[#define yolo ({ (666 + 666); })]
[int f () { int i = yolo; yolo; return i; }]
)
dnl a new warning in gcc 8, glib 2.55 doesn't play nice yet
dnl https://bugzilla.gnome.org/show_bug.cgi?id=793272
NM_COMPILER_WARNING([$1], [cast-function-type],
[#include <glib-object.h>]
[typedef struct { GObject parent; } NMObject;]
[typedef struct { GObjectClass parent; } NMObjectClass;]
[static void nm_object_init (NMObject *object) { } ]
[static void nm_object_class_init (NMObjectClass *object) { }]
[G_DEFINE_TYPE (NMObject, nm_object, G_TYPE_OBJECT)]
)
dnl clang started supporting -Wimplicit-fallthrough, but it does not
dnl honor the code comments to suppress the warning. Disable the
dnl warning with clang.
dnl
NM_COMPILER_WARNING([$1], [implicit-fallthrough],
[int foo(int a);
int foo(int a) {
int r = 0;
switch (a) {
case 1:
r++;
/* fall-through */
case 2:
r++;
break;
}
return r;
}]
)
eval "AS_TR_SH([$1])='$CFLAGS_MORE_WARNINGS $$1'"
else
AC_MSG_RESULT(no)
fi
])
AC_DEFUN([NM_LTO],
[AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size [default=no]]))
if (test "${enable_lto}" = "yes"); then
CC_CHECK_FLAG_APPEND([lto_flags], [CFLAGS], [-flto -flto-partition=none])
if (test -n "${lto_flags}"); then
CFLAGS="-flto -flto-partition=none $CFLAGS"
else
AC_MSG_ERROR([Link Time Optimization -flto is not supported.])
fi
else
enable_lto='no'
fi
])
AC_DEFUN([NM_LD_GC],
[AC_ARG_ENABLE(ld-gc, AS_HELP_STRING([--enable-ld-gc], [Enable garbage collection of unused symbols on linking [default=auto]]))
if (test "${enable_ld_gc}" != "no"); then
CC_CHECK_FLAG_APPEND([ld_gc_flags], [CFLAGS], [-fdata-sections -ffunction-sections -Wl,--gc-sections])
if (test -n "${ld_gc_flags}"); then
enable_ld_gc="yes"
CFLAGS="$ld_gc_flags $CFLAGS"
else
if (test "${enable_ld_gc}" = "yes"); then
AC_MSG_ERROR([Unused symbol eviction requested but not supported.])
else
enable_ld_gc="no"
fi
fi
fi
])

View File

@@ -1,15 +0,0 @@
dnl GIT_SHA_RECORD($1, $2)
dnl
dnl $1: the name of the assigned variable. For example NM_GIT_SHA,
dnl NMA_GIT_SHA, LIBNL_GIT_SHA.
dnl $2: by default, a define to config.h is added. This can be
dnl suppressed by passing "no-config-h".
dnl
AC_DEFUN([GIT_SHA_RECORD], [
m4_define([git_sha_record_v],
[m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
$1=git_sha_record_v
if test ""$2"" != "no-config-h" ; then
AC_DEFINE_UNQUOTED($1,"$$1",[git commit id of the original source code version])
fi
])

View File

@@ -1,142 +0,0 @@
dnl GNOME_CODE_COVERAGE
dnl
dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
dnl (program or library) which should be built with code coverage support.
dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
dnl Makefile; and $enable_code_coverage which can be used in subsequent
dnl configure output.
dnl
dnl Note that all optimisation flags in CFLAGS must be disabled when code
dnl coverage is enabled.
dnl
dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
dnl This file is licenced under LGPLv2.1+.
dnl
dnl Usage example:
dnl configure.ac:
dnl GNOME_CODE_COVERAGE
dnl
dnl Makefile.am:
dnl @GNOME_CODE_COVERAGE_RULES@
dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
dnl
dnl This results in a “check-code-coverage” rule being added to any Makefile.am
dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
dnl configured with --enable-code-coverage). Running `make check-code-coverage`
dnl in that directory will run the modules test suite (`make check`) and build
dnl a code coverage report detailing the code which was touched, then print the
dnl URI for the report.
AC_DEFUN([GNOME_CODE_COVERAGE],[
dnl Check for --enable-code-coverage
AC_MSG_CHECKING([whether to build with code coverage support])
AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
AC_MSG_RESULT($enable_code_coverage)
AS_IF([ test "$enable_code_coverage" = "yes" ], [
dnl Check if gcc is being used
AS_IF([ test "$GCC" = "no" ], [
AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
])
AC_CHECK_PROG([LCOV], [lcov], [lcov])
AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
AS_IF([ test -z "$LCOV" ], [
AC_MSG_ERROR([lcov is needed to enable code coverage reporting])
])
AS_IF([ test -z "$GENHTML" ], [
AC_MSG_ERROR([Could not find genhtml from the lcov package])
])
dnl Build the code coverage flags
CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
CODE_COVERAGE_LDFLAGS="-lgcov"
AC_SUBST([CODE_COVERAGE_CFLAGS])
AC_SUBST([CODE_COVERAGE_LDFLAGS])
])
GNOME_CODE_COVERAGE_RULES='
# Code coverage
#
# Optional:
# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
# (Default: $(top_builddir))
# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
# by lcov for code coverage. (Default:
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
# reports to be created. (Default:
# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
# (Default: empty)
# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
# instance. (Default: empty)
# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
#
# The generated report will be titled using the $(PACKAGE_NAME) and
# $(PACKAGE_VERSION). In order to add the current git hash to the title,
# use the git-version-gen script, available online.
# Optional variables
CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
CODE_COVERAGE_LCOV_OPTIONS ?=
CODE_COVERAGE_GENHTML_OPTIONS ?=
CODE_COVERAGE_IGNORE_PATTERN ?=
code_coverage_quiet = $(code_coverage_quiet_$(V))
code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
code_coverage_quiet_0 = --quiet
# Use recursive makes in order to ignore errors during check
check-code-coverage:
ifeq ($(CODE_COVERAGE_ENABLED),yes)
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
else
@echo "Need to reconfigure with --enable-code-coverage"
endif
# Capture code coverage data
code-coverage-capture: code-coverage-capture-hook
ifeq ($(CODE_COVERAGE_ENABLED),yes)
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
@echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
else
@echo "Need to reconfigure with --enable-code-coverage"
endif
# Hook rule executed before code-coverage-capture, overridable by the user
code-coverage-capture-hook:
ifeq ($(CODE_COVERAGE_ENABLED),yes)
clean: code-coverage-clean
code-coverage-clean:
-$(LCOV) --directory $(top_builddir) -z
-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-find . -name "*.gcda" -o -name "*.gcov" -delete
endif
GITIGNOREFILES ?=
GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
DISTCHECK_CONFIGURE_FLAGS ?=
DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
'
AC_SUBST([GNOME_CODE_COVERAGE_RULES])
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
])

View File

@@ -1,92 +0,0 @@
dnl Copyright 2009 Johan Dahlin
dnl
dnl This file is free software; the author(s) gives unlimited
dnl permission to copy and/or distribute it, with or without
dnl modifications, as long as this notice is preserved.
dnl
# serial 1
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
[
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
dnl enable/disable introspection
m4_if([$2], [require],
[dnl
enable_introspection=yes
],[dnl
AC_ARG_ENABLE(introspection,
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
[Enable introspection for this build]),,
[enable_introspection=auto])
])dnl
INTROSPECTION_SCANNER=
INTROSPECTION_COMPILER=
INTROSPECTION_GENERATE=
INTROSPECTION_GIRDIR=
INTROSPECTION_TYPELIBDIR=
if test "x$enable_introspection" = "xno"; then
found_introspection="no"
else
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], [
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
AC_MSG_CHECKING([if $INTROSPECTION_SCANNER works])
if CFLAGS="${CFLAGS} -Wno-error" "$INTROSPECTION_SCANNER" --namespace=test --library=c /dev/null --output /dev/null >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
found_introspection=yes
else
found_introspection="no (compiler failure -- check config.log)"
fi
AC_MSG_RESULT([$found_introspection])
], [found_introspection="no (not installed)"])
if test "x$enable_introspection" = "xyes"; then
if test "x$found_introspection" != "xyes"; then
AC_MSG_ERROR([introspection enabled but can't be used])
fi
elif test "x$enable_introspection" != "xauto"; then
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
fi
fi
AC_SUBST(INTROSPECTION_SCANNER, 'CFLAGS="${CFLAGS} -Wno-error" '"$INTROSPECTION_SCANNER")
AC_SUBST(INTROSPECTION_COMPILER)
AC_SUBST(INTROSPECTION_GENERATE)
AC_SUBST(INTROSPECTION_GIRDIR)
AC_SUBST(INTROSPECTION_TYPELIBDIR)
AC_SUBST(INTROSPECTION_CFLAGS)
AC_SUBST(INTROSPECTION_LIBS)
AC_SUBST(INTROSPECTION_MAKEFILE)
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
])
dnl Usage:
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
[
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
])

View File

@@ -1,87 +0,0 @@
dnl vala.m4
dnl
dnl Copyright 2012 Evan Nemerson
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library.
# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND-INTROSPECTION])
# --------------------------------------
# Check that vapigen existence and version
#
# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
AC_DEFUN([VAPIGEN_CHECK],
[
AC_BEFORE([GOBJECT_INTROSPECTION_CHECK],[$0])
AC_BEFORE([GOBJECT_INTROSPECTION_REQUIRE],[$0])
AC_ARG_ENABLE([vala],
AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],
[build Vala bindings [default=auto]]),,
[enable_vala=auto])
AS_CASE([$enable_vala], [no], [],
[yes], [
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
AC_MSG_ERROR([Vala bindings require GObject Introspection])
])
], [auto], [
AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
enable_vala=no
])
], [
AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@])
])
AS_IF([test "x$2" = "x"], [
vapigen_pkg_name=vapigen
], [
vapigen_pkg_name=vapigen-$2
])
AS_IF([test "x$1" = "x"], [
vapigen_pkg="$vapigen_pkg_name"
], [
vapigen_pkg="$vapigen_pkg_name >= $1"
])
PKG_PROG_PKG_CONFIG
PKG_CHECK_EXISTS([$vapigen_pkg], [
AS_IF([test "$enable_vala" = "auto"], [
enable_vala=yes
])
], [
AS_CASE([$enable_vala], [yes], [
AC_MSG_ERROR([$vapigen_pkg not found])
], [auto], [
enable_vala=no
])
])
AS_CASE([$enable_vala],
[yes], [
VAPIGEN=`$PKG_CONFIG --variable=vapigen vapigen`
VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir vapigen`/vala/Makefile.vapigen
AS_IF([test "x$2" = "x"], [
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir vapigen`
], [
VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned vapigen`
])
])
AC_SUBST([VAPIGEN])
AC_SUBST([VAPIGEN_VAPIDIR])
AC_SUBST([VAPIGEN_MAKEFILE])
AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes")
])

View File

@@ -50,9 +50,10 @@
NetworkManager-dispatcher will execute scripts in the
<filename>/{etc,usr/lib}/NetworkManager/dispatcher.d</filename>
directory or subdirectories in
alphabetical order in response to network events. Each script should
be a regular executable file owned by root. Furthermore, it must not be
writable by group or other, and not setuid.
alphabetical order in response to network events. Files in <filename>/etc</filename>
take precedence over identically-named files in <filename>/usr/lib</filename>.
Each script should be a regular executable file owned by root. Furthermore, it must
not be writable by group or other, and not setuid.
</para>
<para>
Each script receives two arguments, the first being the interface name of the

View File

@@ -167,18 +167,14 @@ plugins-=remove-me
</varlistentry>
<varlistentry>
<term><varname>dhcp</varname></term>
<listitem><para>This key sets up what DHCP client
NetworkManager will use. Allowed values are
<literal>dhclient</literal>, <literal>dhcpcd</literal>, and
<literal>internal</literal>. The <literal>dhclient</literal>
and <literal>dhcpcd</literal> options require the indicated
clients to be installed. The <literal>internal</literal>
option uses a built-in DHCP client which is not currently as
featureful as the external clients.</para>
<para>If this key is missing, it defaults to <literal>&NM_CONFIG_DEFAULT_MAIN_DHCP;</literal>.
If the chosen plugin is not available, clients are looked for
in this order: <literal>dhclient</literal>, <literal>dhcpcd</literal>,
<literal>internal</literal>.</para></listitem>
<listitem><para>This key sets up what DHCP client NetworkManager will
use. Allowed values depend on build configuration; this version of
NetworkManager was built with support for the following clients:
&NM_DHCP_CLIENTS_ENABLED_TEXT;.</para>
<para>The <literal>internal</literal> client is built-in, while other options
may require an external DHCP client to be installed.</para>
<para>If this key is missing, <literal>&NM_CONFIG_DEFAULT_MAIN_DHCP;</literal>
is used with a fallback to other supported clients.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>no-auto-default</varname></term>
@@ -219,7 +215,7 @@ no-auto-default=*
if specified (See <xref linkend="ignore-carrier"/>).
Otherwise, it is a list of matches to specify for which device
carrier should be ignored. See <xref linkend="device-spec"/> for the
syntax how to specify a device. Note that master types like
syntax how to specify a device. Note that controller types like
bond, bridge, and team ignore carrier by default. You can however
revert that default using the "except:" specifier (or better,
use the per-device setting instead of the deprecated setting).
@@ -275,8 +271,7 @@ no-auto-default=*
Set the management mode of the hostname. This parameter will
affect only the transient hostname. If a valid static hostname is set,
NetworkManager will skip the update of the hostname despite the value of
this option. An hostname empty or equal to 'localhost', 'localhost6',
'localhost.localdomain' or 'localhost6.localdomain' is considered invalid.
this option. A hostname empty or equal to '(none)' is considered invalid.
</para>
<para><literal>default</literal>: NetworkManager will update the
hostname with the one provided via DHCP or reverse DNS lookup of the
@@ -336,20 +331,24 @@ no-auto-default=*
<para><literal>systemd-resolved</literal>: NetworkManager will
push the DNS configuration to systemd-resolved</para>
<para><literal>dnsconfd</literal>: NetworkManager will
push the DNS configuration to dnsconfd</para> and by default set ipvX.routed-dns to
yes, so servers are contacted through right interfaces.
<para><literal>none</literal>: NetworkManager will not
modify resolv.conf. This implies
<literal>rc-manager</literal>&nbsp;<literal>unmanaged</literal></para>
<para>Note that the plugins <literal>dnsmasq</literal> and <literal>systemd-resolved</literal>
are caching local nameservers.
<para>Note that the plugins <literal>dnsmasq</literal>,<literal>systemd-resolved</literal>
and <literal>dnsconfd</literal> are caching local nameservers.
Hence, when NetworkManager writes <filename>&nmrundir;/resolv.conf</filename>
and <filename>/etc/resolv.conf</filename> (according to <literal>rc-manager</literal>
setting below), the name server there will be localhost only.
NetworkManager also writes a file <filename>&nmrundir;/no-stub-resolv.conf</filename>
that contains the original name servers pushed to the DNS plugin.</para>
<para>When using <literal>dnsmasq</literal> and <literal>systemd-resolved</literal>,
per-connection added dns servers will always be queried using
<para>When using <literal>dnsmasq</literal>,<literal>systemd-resolved</literal> and
<literal>dnsconfd</literal> per-connection added dns servers will always be queried using
the device the connection has been activated on.</para>
</listitem>
</varlistentry>
@@ -361,7 +360,7 @@ no-auto-default=*
management mode. This option is about how NetworkManager writes to
<filename>/etc/resolv.conf</filename>, if at all.
The default value depends on NetworkManager build
options, and this version of NetworkManager was build with a default of
options, and this version of NetworkManager was built with a default of
"<literal>&NM_CONFIG_DEFAULT_MAIN_RC_MANAGER;</literal>".
Regardless of this setting, NetworkManager will
always write its version of resolv.conf to its runtime state directory
@@ -857,13 +856,22 @@ ipv6.ip6-privacy=0
<listitem><para>If left unspecified, the default value is 3 tries before failing the connection.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.autoconnect-ports</varname></term>
</varlistentry>
<varlistentry>
<term><varname>connection.autoconnect-slaves</varname></term>
<listitem><para>This is deprecated, please use "connection.autoconnect-ports" instead.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.down-on-poweroff</varname></term>
<listitem><para>Whether the connection will be brought down before the system is powered off.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.ip-ping-addresses-require-all</varname></term>
<listitem><para>Whether it is sufficient for any ping check to succeed among the list of target addresses, or if all ping checks must succeed for the entire list of target addresses.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.mud-url</varname></term>
<listitem><para>If unspecified, MUD URL defaults to <literal>"none"</literal>.</para></listitem>
@@ -933,6 +941,13 @@ ipv6.ip6-privacy=0
<term><varname>ip-tunnel.mtu</varname></term>
<listitem><para>If configured explicitly to 0, the MTU is not reconfigured during device activation unless it is required due to IPv6 constraints. If left unspecified, a DHCP/IPv6 SLAAC provided value is used or a default of 1500.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.forwarding</varname></term>
<listitem><para>Whether to configure IPv4 sysctl interface-specific forwarding. When enabled, the interface will act as a router to forward the IPv4 packet from one interface to another. If left unspecified, "auto" is used, so NetworkManager sets the IPv4 forwarding if any shared connection is active, or it will use the kernel default value otherwise. The "ipv4.forwarding" property is ignored when "ipv4.method" is set to "shared", because forwarding is always enabled in this case. The accepted values are: 0: disabled, 1: enabled, 2: auto, 3: ignored (leave the forwarding unchanged).</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.routed-dns</varname></term>
</varlistentry>
<varlistentry>
<term><varname>ipv4.dad-timeout</varname></term>
</varlistentry>
@@ -946,10 +961,18 @@ ipv6.ip6-privacy=0
<term><varname>ipv4.dhcp-iaid</varname></term>
<listitem><para>If left unspecified, it defaults to "ifname".</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.dhcp-ipv6-only-preferred</varname></term>
<listitem><para>If left unspecified, the "IPv6-only preferred" DHCPv4 option is disabled.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.dhcp-hostname-flags</varname></term>
<listitem><para>If left unspecified, the value 3 (fqdn-encoded,fqdn-serv-update) is used.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.dhcp-send-hostname</varname></term>
<listitem><para>Whether a hostname is sent to the DHCP server when acquiring a lease. When the property is not specified in the connection, the global value from NetworkManager configuration is looked up. If the global value is not set, the value from ipv4.dhcp-send-hostname-deprecated, which defaults to true, is used for backwards compatibility. In the future this will change and, in absence of a global default, it will always fallback to true.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.dhcp-send-release</varname></term>
<listitem><para>Whether the DHCP client will send RELEASE message when bringing the connection down.</para></listitem>
@@ -985,6 +1008,9 @@ ipv6.ip6-privacy=0
removes extraneous routes from the tables.
</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv6.routed-dns</varname></term>
</varlistentry>
<varlistentry>
<term><varname>ipv6.addr-gen-mode</varname></term>
<listitem><para>If the per-profile setting is either "default" or "default-or-eui64", the
@@ -1007,6 +1033,10 @@ ipv6.ip6-privacy=0
<term><varname>ipv6.dhcp-hostname-flags</varname></term>
<listitem><para>If left unspecified, the value 1 (fqdn-serv-update) is used.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv6.dhcp-send-hostname</varname></term>
<listitem><para>Whether a hostname is sent to the DHCP server when acquiring a lease. When the property is not specified in the connection, the global value from NetworkManager configuration is looked up. If the global value is not set, the value from ipv6.dhcp-send-hostname-deprecated, which defaults to true, is used for backwards compatibility. In the future this will change and, in absence of a global default, it will always fallback to true.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv6.dhcp-send-release</varname></term>
<listitem><para>Whether the DHCP client will send RELEASE message when bringing the connection down.</para></listitem>
@@ -1063,6 +1093,12 @@ ipv6.ip6-privacy=0
<term><varname>sriov.autoprobe-drivers</varname></term>
<listitem><para>If left unspecified, drivers are autoprobed when the SR-IOV VF gets created.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>sriov.preserve-on-down</varname></term>
<listitem><para>Set to 0 or 1 to select whether the SR-IOV parameters are
preserved when the connection is deactivated. If left unspecified, default
to 0 (parameters are not preserved). </para></listitem>
</varlistentry>
<varlistentry>
<term><varname>vpn.timeout</varname></term>
<listitem><para>If left unspecified, default value of 60 seconds is used.</para></listitem>
@@ -1125,7 +1161,7 @@ ipv6.ip6-privacy=0
<programlisting>
[connection]
ipv6.ip6-privacy=0
connection.autoconnect-slaves=1
connection.autoconnect-ports=1
vpn.timeout=120
[connection-wifi-wlan0]
@@ -1348,7 +1384,7 @@ managed=1
scanning. This defaults to <literal>yes</literal> in which case
a random, locally-administered MAC address will be used.
The setting <literal>wifi.scan-generate-mac-address-mask</literal>
allows to influence the generated MAC address to use certain vendor
can be used to influence the generated MAC address to use certain vendor
OUIs.
If disabled, the MAC address during scanning is left unchanged to
whatever is configured.
@@ -1372,7 +1408,7 @@ managed=1
<listitem>
<para>
Like the per-connection settings <literal>ethernet.generate-mac-address-mask</literal>
and <literal>wifi.generate-mac-address-mask</literal>, this allows to configure the
and <literal>wifi.generate-mac-address-mask</literal>, this can be used to configure the
generated MAC addresses during scanning. See <citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details.
</para>
@@ -1480,12 +1516,18 @@ managed=1
set to 0 connectivity checking is disabled. If missing, the
default is 300 seconds.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>timeout</varname></term>
<listitem><para>Specified in seconds; controls how long
to wait for a response before connectivity is marked as
limited. If missing, the default is 20 seconds.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>response</varname></term>
<listitem><para>If set, controls what body content
NetworkManager checks for when requesting the URI for
connectivity checking. Note that this only compares
that the HTTP response starts with the specifid text,
that the HTTP response starts with the specified text,
it does not compare the exact string. This behavior
might change in the future, so avoid relying on it.
If missing, the response defaults to "NetworkManager is online".
@@ -1518,6 +1560,29 @@ managed=1
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>resolve-mode</varname></term>
<listitem>
<para>
String indicating how DNS servers retrieved from global configuration and connections
should be used. <literal>backup</literal> - Indicates that they can be freely merged
and used for the same purposes. <literal>prefer</literal> - Forbids DNS servers
retrieved from connections to be used for general queries that are not subdomains of
domains set by connection. <literal>exclusive</literal> - Forbids use of connection
DNS servers for any query. Currently relevant only for Dnsconfd plugin.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>certification-authority</varname></term>
<listitem>
<para>
String specifying absolute path to bundle of CA certificates that must be used for
validation of certificates presented by DNS servers when encrypted DNS is used.
Currently relevant only for Dnsconfd plugin.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
@@ -1525,7 +1590,7 @@ managed=1
<refsect1>
<title><literal>global-dns-domain</literal> sections</title>
<para>Sections with a name starting with the "global-dns-domain-"
prefix allow to define global DNS configuration for specific
prefix allow one to define global DNS configuration for specific
domains. The part of section name after "global-dns-domain-"
specifies the domain name a section applies to (for example, a
section could be named "global-dns-domain-foobar.com"). More
@@ -1543,8 +1608,24 @@ managed=1
<term><varname>servers</varname></term>
<listitem>
<para>
A list of addresses of DNS servers to be used for the given domain.
</para>
A list of addresses of DNS servers to be used for the
given domain. Each server can be specified either as a
plain IP address or with a URI syntax. When it is
specified as an URI, the following forms are supported:
</para>
<para>
<simplelist type="horiz" columns="1">
<member>dns+udp://<varname>ADDRESS</varname>[:<varname>PORT</varname>] : DNS</member>
<member>dns+tls://<varname>ADDRESS</varname>[:<varname>PORT</varname>][#<varname>SERVERNAME]</varname> : DNS over TLS</member>
</simplelist>
</para>
<para>
<varname>ADDRESS</varname> is an IPv4 or IPv6
address. When it is IPv6, it must be enclosed in square
brackets ('[' and ']'). When it is a IPv6 link-local
address, the address should be followed by a percent
sign ('%') and an interface name.
</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -1861,7 +1942,7 @@ interface-name:vboxnet*,except:interface-name:vboxnet2
<literal>"uuid:83037490-1d17-4986-a397-01f1db3a7fc2"</literal></para></listitem>
</varlistentry>
<varlistentry>
<term>id=ID</term>
<term>id:ID</term>
<listitem><para>Match the connection by name.</para></listitem>
</varlistentry>
<varlistentry>

View File

@@ -10,3 +10,4 @@
<!ENTITY NM_CONFIG_DEFAULT_MAIN_DHCP "@NM_CONFIG_DEFAULT_MAIN_DHCP@">
<!ENTITY NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT "@NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT@">
<!ENTITY NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT "@NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT@">
<!ENTITY NM_DHCP_CLIENTS_ENABLED_TEXT "@NM_DHCP_CLIENTS_ENABLED@">

View File

@@ -1,29 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
common_ent_file = configure_file(
input: 'common.ent.in',
output: '@BASENAME@',
configuration: data_conf,
)
xsltproc_options = [
xsltproc,
'--output', '@OUTPUT@',
'--path', meson.current_build_dir(),
'--xinclude',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'--stringparam', 'man.th.title.max.length', '30',
]
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
mans_xmls = []
mans = [
['NetworkManager', '8'],
['NetworkManager-dispatcher', '8'],
@@ -44,24 +20,74 @@ if enable_nm_cloud_setup
mans += [['nm-cloud-setup', '8']]
endif
foreach man: mans
input = man[0] + '.xml'
content_files += join_paths(meson.current_source_dir(), input)
introspection_mans = [
['nm-settings-keyfile', '5'],
['nm-settings-dbus', '5'],
['nm-settings-nmcli', '5'],
]
output = '@0@.@1@'.format(man[0], man[1])
if enable_ifcfg_rh
introspection_mans += [['nm-settings-ifcfg-rh', '5']]
endif
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
depend_files: common_ent_file,
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
built_mans = []
foreach man: mans + introspection_mans
name = man[0] + '.' + man[1]
if not fs.exists(name)
built_mans = []
break
endif
built_mans += name
endforeach
if enable_introspection
if enable_introspection or enable_docs
common_ent_file = configure_file(
input: 'common.ent.in',
output: '@BASENAME@',
configuration: data_conf,
)
endif
if enable_introspection and (enable_man or enable_docs)
xsltproc_options = [
find_program('xsltproc'),
'--output', '@OUTPUT@',
'--path', meson.current_build_dir(),
'--xinclude',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'--stringparam', 'man.th.title.max.length', '30',
]
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
mans_xmls = []
foreach man: mans
input = man[0] + '.xml'
content_files += join_paths(meson.current_source_dir(), input)
output = '@0@.@1@'.format(man[0], man[1])
# not needed if only html requested
if enable_man
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
depend_files: common_ent_file,
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
endif
endforeach
merge_cmd = files(source_root / 'tools' / 'generate-docs-nm-settings-docs-merge.py')
name = 'dbus'
@@ -124,13 +150,23 @@ if enable_introspection
output = '@0@.@1@'.format(man[0], man[1])
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
# not needed if only html requested
if enable_man
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
endif
endforeach
# not needed if only html requested
elif enable_man
if built_mans.length() > 0
install_man(built_mans)
else
error('Building manpages requires xsltproc and -Dintrospection=true, and no prebuilt manpages were found. Try building from a release tarball or using -Dman=false.')
endif
endif

View File

@@ -115,9 +115,9 @@
<title>nm-cloud-setup.service systemd unit</title>
<para>Usually <command>/usr/libexec/nm-cloud-setup</command> is not run directly,
but only by <command>systemctl restart nm-cloud-setup.service</command>. This
ensures that the tool only runs once at any time. It also allows to integrate
with the nm-cloud-setup systemd timer,
and to enable/disable the service via systemd.</para>
ensures that the tool only runs once at any time.
The unit is also used by the nm-cloud-setup systemd timer and allows
enabling/disabling the service via systemd.</para>
<para>As you need to set environment variable to configure nm-cloud-setup binary,
you can do so via systemd override files. Try <command>systemctl edit nm-cloud-setup.service</command>.</para>
@@ -184,6 +184,10 @@
<para><literal>NM_CLOUD_SETUP_ALIYUN</literal>: boolean, whether Alibaba Cloud (Aliyun) support is enabled. Defaults
to <literal>no</literal>.</para>
</listitem>
<listitem>
<para><literal>NM_CLOUD_SETUP_OCI</literal>: boolean, whether Oracle Cloud (OCI) support is enabled. Defaults
to <literal>no</literal>.</para>
</listitem>
</itemizedlist>
</refsect1>
@@ -417,6 +421,34 @@ ln -s /etc/systemd/system/timers.target.wants/nm-cloud-setup.timer /usr/lib/syst
</itemizedlist>
</refsect2>
<refsect2>
<title>Oracle Cloud (OCI)</title>
<para>For OCI, the tools tries to fetch configuration from <literal>http://169.254.169.254/</literal>. Currently, it only
configures IPv4 and does nothing about IPv6. It will do the following.</para>
<itemizedlist>
<listitem>
<para>First fetch <literal>http://169.254.169.254/opc/v2/instance</literal> to determine whether the
expected API is present. This determines whether OCI environment is detected and whether to proceed
to configure the host using OCI meta data.</para>
</listitem>
<listitem>
<para>Fetch <literal>http://169.254.169.254/opc/v2/vnics</literal> to get the configuration
for all the VNICs, getting their MAC address, private IP address, gateway and subnet block.</para>
</listitem>
<listitem>
<para>Then nm-cloud-setup iterates over all interfaces for which it could fetch a configuration.
If no ethernet device for the respective MAC address is found, it is skipped.
Also, if the device is currently not activated in NetworkManager or if the currently
activated profile has a user-data <literal>org.freedesktop.nm-cloud-setup.skip=yes</literal>,
it is skipped. Also, there is only one interface and one IP address, the tool does nothing.</para>
<para>Then the tool configures the system like doing for AWS environment. That is, using source based policy routing
with the tables/rules 30200/30400.</para>
</listitem>
</itemizedlist>
</refsect2>
</refsect1>
<refsect1>

View File

@@ -154,9 +154,13 @@
<member><option>net.ifnames</option></member>
<member><option>rd.peerdns</option></member>
<member><option>rd.iscsi.ibft</option></member>
<member><option>rd.nvmf.nonbft</option></member>
<member><option>rd.bootif</option></member>
<member><option>rd.neednet</option></member>
<member><option>rd.ethtool</option></member>
<member><option>rd.net.dns</option></member>
<member><option>rd.net.dns-backend</option></member>
<member><option>rd.net.dns-resolve-mode</option></member>
<member><option>rd.net.timeout.dhcp</option></member>
<member><option>rd.net.dhcp.retry</option></member>
<member><option>rd.net.dhcp.vendor-class</option></member>
@@ -225,6 +229,37 @@
</para>
</listitem>
<listitem>
<para>NetworkManager supports the
<option>rd.net.dns-backend</option>=<replaceable>VALUE</replaceable>
kernel command line option to configure the DNS processing
mode. See the description of the <literal>"dns"</literal> key in
the <literal>"main section"</literal> paragraph of <link
linkend='NetworkManager.conf'><citerefentry><refentrytitle>NetworkManager.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>. For
example: <literal>rd.net.dns-backend=systemd-resolved</literal>,
<literal>rd.net.dns-backend=dnsconfd</literal>
</para>
</listitem>
<listitem>
<para>NetworkManager supports the
<option>rd.net.dns</option>=<replaceable>SERVER</replaceable>
kernel command line option to configure a global (non
interface-specific) DNS server. The option can be specified
multiple time to add more than one server. Each server can be
specified as a plain IP or as an URI according to the
description in the "global-dns-domains sections" paragraph of
<link
linkend='NetworkManager.conf'><citerefentry><refentrytitle>NetworkManager.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>. For
example: <literal>rd.net.dns=2001:db8::1</literal>,
<literal>rd.net.dns=dns+tls://192.0.2.0</literal>,
<literal>rd.net.dns=dns+tls://[2001:db8::2]:5353#example.org</literal>.
In addition, it supports configuring the <literal>"resolve-mode"</literal>
key in the global DNS configuration via the
<option>rd.net.dns-resolve-mode</option> command line option.
</para>
</listitem>
<listitem>
<para>NetworkManager supports the
<option>rd.net.dhcp.dscp</option>={<replaceable>CS0</replaceable>|<replaceable>CS4</replaceable>|<replaceable>CS6</replaceable>}

View File

@@ -57,8 +57,8 @@
</listitem>
<listitem>
<para>The configuration is made up of Bridges, Ports and
Interfaces. Interfaces are always enslaved to Ports, and Ports are always
enslaved to Bridges.</para>
Interfaces. Interfaces are always attached to Ports, and Ports are always
attached to Bridges.</para>
</listitem>
<listitem>
<para>NetworkManager only creates Bridges, Ports and Interfaces
@@ -66,7 +66,7 @@
local interface nor its port automatically.</para>
</listitem>
<listitem>
<para>You can't enslave Interface directly to a Bridge. You
<para>You can't attach Interface directly to a Bridge. You
always need a Port, even if it has just one interface.</para>
</listitem>
<listitem>
@@ -89,7 +89,7 @@
<link linkend="nm-settings.property.connection.type">type</link>.
Due to the limitations of OVSDB, "empty" Bridges (with no Ports) can't exist.
NetworkManager inserts the records for Bridges into OVSDB when a Port is
enslaved.
attached.
</para>
</refsect2>
@@ -101,18 +101,18 @@
Due to the limitations of OVSDB, "empty" Ports (with no Interfaces) can't
exist. Ports can also be configured to do VLAN tagging or Bonding.
NetworkManager inserts the records for Ports into OVSDB when an Interface is
enslaved. Ports must be enslaved to a Bridge.</para>
attached. Ports must be attached to a Bridge.</para>
</refsect2>
<refsect2>
<title>Interfaces</title>
<para>Interfaces are represented by a connections enslaved to a Port. The
<para>Interfaces are represented by a connections attached to a Port. The
system interfaces (that have a corresponding Linux link) have a respective
<link linkend="nm-settings.property.connection.type">connection.type</link>
of the link (e.g. "wired", "bond", "dummy", etc.). Other interfaces ("internal"
or "patch" interfaces) are of ovs-interface type. The OVSDB entries are
inserted upon enslavement to a Port.</para>
inserted upon attachment to a Port.</para>
</refsect2>
</refsect1>
@@ -123,10 +123,10 @@
<example><title>Creating a Bridge with a single internal Interface</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-bridge conn.interface bridge0</userinput>
Connection 'ovs-bridge-bridge0' (d10fc64d-1d48-4394-a1b8-e1aea72f27d5) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port0 master bridge0</userinput>
<prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port0 controller bridge0</userinput>
Connection 'ovs-port-port0' (5ae22bae-bba4-4815-9ade-7e635633e1f0) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ovs-interface slave-type ovs-port conn.interface iface0 \
master port0 ipv4.method manual ipv4.address 192.0.2.1/24</userinput>
<prompt>$ </prompt><userinput>nmcli conn add type ovs-interface port-type ovs-port conn.interface iface0 \
controller port0 ipv4.method manual ipv4.address 192.0.2.1/24</userinput>
Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) successfully added.
</screen>
<para>As said above, you need to create a Port even for a single interface.
@@ -136,29 +136,29 @@ Connection 'ovs-interface-iface0' (3640d2a1-a2fd-4718-92f1-cffadb5b6cdc) success
</example>
<example><title>Adding a Linux interface to a Bridge</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port1 master bridge0</userinput>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port1 controller bridge0</userinput>
Connection 'ovs-port-port1' (67d041eb-8e7b-4458-afee-a1d07c9c4552) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth0 master port1</userinput>
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth0 controller port1</userinput>
Connection 'ovs-slave-eth0' (d459c45c-cf78-4c1c-b4b7-505e71379624) successfully added.
</screen>
<para>Again, you need a port.</para>
</example>
<example><title>Creating a VLAN</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port2 master bridge0 ovs-port.tag 120</userinput>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface port2 controller bridge0 ovs-port.tag 120</userinput>
Connection 'ovs-port-port2' (3994c093-4ef7-4549-a4fd-627b831c3cb8) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth1 master port2</userinput>
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth1 controller port2</userinput>
Connection 'ovs-slave-eth1' (099be06e-71ad-484d-8d5a-fcadc5f207f5) successfully added.
</screen>
<para>It's just a port with a tag.</para>
</example>
<example><title>Creating a Bond</title>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface bond0 master bridge0</userinput>
<screen><prompt>$ </prompt><userinput>nmcli conn add type ovs-port conn.interface bond0 controller bridge0</userinput>
Connection 'ovs-port-bond0' (d154ebf9-e999-4e1b-a084-a3de53d25d8a) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth2 master bond0</userinput>
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth2 controller bond0</userinput>
Connection 'ovs-slave-eth2' (475ac1bf-30b2-4534-a877-27f33f58b082) successfully added.
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth3 master bond0</userinput>
<prompt>$ </prompt><userinput>nmcli conn add type ethernet conn.interface eth3 controller bond0</userinput>
Connection 'ovs-slave-eth3' (8dedeecb-ed12-482b-b77a-24a4fb835136) successfully added.
</screen>
<para>It's just a Port with multiple interfaces. See nm-settings-nmcli manual for

View File

@@ -153,8 +153,8 @@ BOOTPROTO=dhcp
<para>
<programlisting>
<emphasis role="bold">Bonding configuration:</emphasis>
ifcfg-BOND: ifcfg-BOND-slave:
NAME=BOND NAME=BOND-slave
ifcfg-BOND: ifcfg-BOND-port:
NAME=BOND NAME=BOND-port
UUID=b41888aa-924c-450c-b0f8-85a4f0a51b4a UUID=9bb048e4-286a-4cc3-b104-007dbd20decb
DEVICE=bond100 DEVICE=eth0
BONDING_OPTS="mode=balance-rr miimon=100" ONBOOT=yes
@@ -177,16 +177,16 @@ NAME=team0-profile
UUID=1d3460a0-7b37-457f-a300-fe8d92da4807
ONBOOT=yes
ifcfg-my_team0_slave1:
NAME=team0-slave1
ifcfg-my_team0_port1:
NAME=team0-port1
UUID=d5aed298-c567-4cc1-b808-6d38ecef9e64
DEVICE=eth1
ONBOOT=yes
TEAM_MASTER=team0
DEVICETYPE=TeamPort
ifcfg-my_team0_slave2:
NAME=team0-slave2
ifcfg-my_team0_port2:
NAME=team0-port2
UUID=94e75f4e-e5ad-401c-8962-31e0ae5d2215
DEVICE=eth2
ONBOOT=yes

View File

@@ -173,8 +173,8 @@ id=MainBridge id=br-port-1
uuid=171ae855-a0ab-42b6-bd0c-60f5812eea9d uuid=d6e8ae98-71f8-4b3d-9d2d-2e26048fe794
interface-name=MainBridge interface-name=em1
type=bridge type=ethernet
master=MainBridge
[bridge] slave-type=bridge
controller=MainBridge
[bridge] port-type=bridge
interface-name=MainBridge
</programlisting>
</para>

View File

@@ -141,7 +141,14 @@
<term>
<option>
<xsl:attribute name="id">nm-settings-nmcli.property.<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@name"/></xsl:attribute>
<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@name"/>
<xsl:choose>
<xsl:when test="@rename">
<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@rename"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$setting_name"/>.<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</option>
</term>
<listitem>

View File

@@ -187,56 +187,56 @@ B,DISPATCH</screen>
</para>
</example>
<example><title>Adding a bonding master and two slave connection profiles</title>
<example><title>Adding a bonding controller and two port connection profiles</title>
<screen><prompt>$ </prompt><userinput>nmcli con add type bond ifname mybond0 mode active-backup</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth1 master mybond0</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth2 master mybond0</userinput></screen>
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth1 controller mybond0</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet ifname eth2 controller mybond0</userinput></screen>
<para>
This example demonstrates adding a bond master connection and two slaves. The
first command adds a master bond connection, naming the bonding interface
This example demonstrates adding a bond controller connection and two ports. The
first command adds a controller bond connection, naming the bonding interface
<emphasis>mybond0</emphasis> and using <emphasis>active-backup</emphasis> mode.
The next two commands add slaves connections, both enslaved to <emphasis>mybond0</emphasis>.
The first slave will be bound to <emphasis>eth1</emphasis> interface, the second to
The next two commands add port connections, both attached as port to <emphasis>mybond0</emphasis>.
The first port will be bound to <emphasis>eth1</emphasis> interface, the second to
<emphasis>eth2</emphasis>.
</para>
</example>
<example><title>Adding a team master and two slave connection profiles</title>
<screen><prompt>$ </prompt><userinput>nmcli con add type team con-name Team1 ifname Team1 config team1-master-json.conf</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave1 ifname em1 master Team1</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-slave2 ifname em2 master Team1</userinput></screen>
<example><title>Adding a team controller and two port connection profiles</title>
<screen><prompt>$ </prompt><userinput>nmcli con add type team con-name Team1 ifname Team1 config team1-controller-json.conf</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-port1 ifname em1 controller Team1</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name Team1-port2 ifname em2 controller Team1</userinput></screen>
<para>
This example demonstrates adding a team master connection profile and two slaves. It is
very similar to the bonding example. The first command adds a master team profile, naming
This example demonstrates adding a team controller connection profile and two ports. It is
very similar to the bonding example. The first command adds a controller team profile, naming
the team interface and the profile <emphasis>Team1</emphasis>. The team configuration
for the master is read from <emphasis>team1-master-json.conf</emphasis> file. Later, you can
for the controller is read from <emphasis>team1-controller-json.conf</emphasis> file. Later, you can
change the configuration with <emphasis>modify</emphasis> command
(<emphasis role="bold">nmcli con modify Team1 team.config team1-master-another-json.conf</emphasis>).
The last two commands add slaves profiles, both enslaved to <emphasis>Team1</emphasis>.
The first slave will be bound to the <emphasis>em1</emphasis> interface, the second to
<emphasis>em2</emphasis>. The slaves don't specify <emphasis>config</emphasis> and thus
(<emphasis role="bold">nmcli con modify Team1 team.config team1-controller-another-json.conf</emphasis>).
The last two commands add port profiles, both attached as port to <emphasis>Team1</emphasis>.
The first port will be bound to the <emphasis>em1</emphasis> interface, the second to
<emphasis>em2</emphasis>. The ports don't specify <emphasis>config</emphasis> and thus
<emphasis>teamd</emphasis> will use its default configuration. You will activate the whole setup
by activating both slaves:
<screen> <prompt>$ </prompt><userinput>nmcli con up Team1-slave1</userinput>
<prompt>$ </prompt><userinput>nmcli con up Team1-slave2</userinput></screen>
by activating both ports:
<screen> <prompt>$ </prompt><userinput>nmcli con up Team1-port1</userinput>
<prompt>$ </prompt><userinput>nmcli con up Team1-port2</userinput></screen>
By default, the created profiles are marked for auto-activation. But if another
connection has been activated on the device, the new profile won't activate
automatically and you need to activate it manually.
</para>
</example>
<example><title>Adding a bridge and two slave profiles</title>
<example><title>Adding a bridge and two port profiles</title>
<screen><prompt>$ </prompt><userinput>nmcli con add type bridge con-name TowerBridge ifname TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-1 ifname ens3 master TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-slave-2 ifname ens4 master TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-port-1 ifname ens3 controller TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con add type ethernet con-name br-port-2 ifname ens4 controller TowerBridge</userinput>
<prompt>$ </prompt><userinput>nmcli con modify TowerBridge bridge.stp no</userinput></screen>
<para>
This example demonstrates adding a bridge master connection and two slaves. The
first command adds a master bridge connection, naming the bridge interface and
This example demonstrates adding a bridge controller connection and two ports. The
first command adds a controller bridge connection, naming the bridge interface and
the profile as <emphasis>TowerBridge</emphasis>.
The next two commands add slaves profiles, both will be enslaved to
The next two commands add ports profiles, both will be attached as port to
<emphasis>TowerBridge</emphasis>.
The first slave will be tied to <emphasis>ens3</emphasis> interface, the second to
The first port will be tied to <emphasis>ens3</emphasis> interface, the second to
<emphasis>ens4</emphasis>.
The last command will disable 802.1D STP for the TowerBridge profile.
</para>
@@ -375,8 +375,8 @@ connection.timestamp: 0
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.controller: --
connection.port-type: --
connection.secondaries:
connection.gateway-ping-timeout: 0
---------------------------------------------------------------------------
@@ -465,8 +465,8 @@ connection.timestamp: 0
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.controller: --
connection.port-type: --
connection.secondaries:
connection.gateway-ping-timeout: 0
---------------------------------------------------------------------------
@@ -525,8 +525,8 @@ connection.timestamp: 0
connection.read-only: no
connection.permissions:
connection.zone: --
connection.master: --
connection.slave-type: --
connection.controller: --
connection.port-type: --
connection.secondaries:
connection.gateway-ping-timeout: 0
---------------------------------------------------------------------------

View File

@@ -1031,7 +1031,7 @@
sort |
awk '
/^(bond|bridge|team)-slave$/ {
printf " <listitem><para><literal>%s</literal> (deprecated for ethernet with master)</para></listitem>\n", $0;
printf " <listitem><para><literal>%s</literal> (deprecated for ethernet with controller)</para></listitem>\n", $0;
next;
}
/^(wifi|ethernet|olpc-mash)$/ {
@@ -1059,26 +1059,27 @@
<listitem><para><literal>adsl</literal></para></listitem>
<listitem><para><literal>bluetooth</literal></para></listitem>
<listitem><para><literal>bond</literal></para></listitem>
<listitem><para><literal>bond-slave</literal> (deprecated for ethernet with master)</para></listitem>
<listitem><para><literal>bond-slave</literal> (deprecated for ethernet with controller)</para></listitem>
<listitem><para><literal>bridge</literal></para></listitem>
<listitem><para><literal>bridge-slave</literal> (deprecated for ethernet with master)</para></listitem>
<listitem><para><literal>bridge-slave</literal> (deprecated for ethernet with controller)</para></listitem>
<listitem><para><literal>cdma</literal></para></listitem>
<listitem><para><literal>dummy</literal></para></listitem>
<listitem><para><literal>generic</literal></para></listitem>
<listitem><para><literal>gsm</literal></para></listitem>
<listitem><para><literal>hsr</literal></para></listitem>
<listitem><para><literal>infiniband</literal></para></listitem>
<listitem><para><literal>ip-tunnel</literal></para></listitem>
<listitem><para><literal>ipvlan</literal></para></listitem>
<listitem><para><literal>loopback</literal></para></listitem>
<listitem><para><literal>macsec</literal></para></listitem>
<listitem><para><literal>macvlan</literal></para></listitem>
<listitem><para><literal>olpc-mesh</literal></para></listitem>
<listitem><para><literal>ovs-bridge</literal></para></listitem>
<listitem><para><literal>ovs-dpdk</literal></para></listitem>
<listitem><para><literal>ovs-interface</literal></para></listitem>
<listitem><para><literal>ovs-patch</literal></para></listitem>
<listitem><para><literal>ovs-port</literal></para></listitem>
<listitem><para><literal>pppoe</literal></para></listitem>
<listitem><para><literal>team</literal></para></listitem>
<listitem><para><literal>team-slave</literal> (deprecated for ethernet with master)</para></listitem>
<listitem><para><literal>team-slave</literal> (deprecated for ethernet with controller)</para></listitem>
<listitem><para><literal>tun</literal></para></listitem>
<listitem><para><literal>veth</literal></para></listitem>
<listitem><para><literal>vlan</literal></para></listitem>

View File

@@ -2,18 +2,17 @@
project(
'NetworkManager', 'c',
# NOTE: When incrementing version also:
# - add corresponding NM_VERSION_x_y_z macros in
# "src/libnm-core-public/nm-version-macros.h.in"
# - update number in configure.ac
version: '1.49.0',
# NOTE: When incrementing version also add corresponding
# NM_VERSION_x_y_z macros in
# "src/libnm-core-public/nm-version-macros.h.in"
version: '1.55.2',
license: 'GPL2+',
default_options: [
'buildtype=debugoptimized',
'c_std=gnu11',
'warning_level=2' # value "2" will add "-Wall" and "-Wextra" to the compiler flags
],
meson_version: '>= 0.51.0',
meson_version: '>= 0.53.0',
)
nm_name = meson.project_name()
@@ -78,6 +77,7 @@ libnm_version = '@0@.@1@.@2@'.format(current - age, age, revision)
libnm_pkgincludedir = join_paths(nm_includedir, libnm_name)
fs = import('fs')
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
@@ -90,7 +90,6 @@ po_dir = source_root / 'po'
top_inc = include_directories('.')
perl = find_program('perl')
xsltproc = find_program('xsltproc')
check_exports = find_program(join_paths(source_root, 'tools', 'check-exports.sh'))
@@ -138,6 +137,9 @@ config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix:
config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include <string.h>'))
config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include <sys/mman.h>'))
config_h.set10('HAVE_DLVSYM', cc.has_function('dlvsym', prefix: '''#define _GNU_SOURCE
#include <dlfcn.h>'''))
# types
config_h.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
config_h.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
@@ -174,11 +176,18 @@ endif
enable_lto = get_option('b_lto')
if enable_lto
# meson already adds '-flto'
lto_flag = '-flto-partition=none'
assert(cc.has_argument(lto_flag), '-flto-partition=none not supported. Disable link-time optimization with -Db_lto=false.')
common_flags += lto_flag
common_ldflags += lto_flag
cc_version = cc.version()
if cc.get_id() == 'clang'
if cc_version <= '18.0.0'
error('Clang version should be greater than 18.0.0, got : ' + cc_version)
endif
elif cc_version < '12.0'
# GCC < 12 breaks libnm symbol versioning with LTO, use workarounds
lto_flag = '-flto-partition=none'
assert(cc.has_argument(lto_flag), '-flto-partition=none not supported. Disable link-time optimization with -Db_lto=false.')
common_flags += lto_flag
common_ldflags += lto_flag
endif
endif
common_flags += cc.get_supported_arguments([
@@ -625,8 +634,9 @@ config_h.set10('WITH_OFONO', enable_ofono)
# DHCP client support
config_dhcp_default = get_option('config_dhcp_default')
config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default)
config_dhcp_clients_enabled = [ 'internal' ]
dhcp_summary = ''
foreach client : [ 'dhclient', 'dhcpcd', 'dhcpcanon' ]
foreach client : [ 'dhcpcd', 'dhclient' ]
client_path = get_option(client)
client_enable = (client_path != 'no')
if client_enable
@@ -656,6 +666,10 @@ foreach client : [ 'dhclient', 'dhcpcd', 'dhcpcanon' ]
dhcp_summary += (' ' + client + ': ' + client_enable.to_string())
if (client_enable)
dhcp_summary += (' ' + client_path)
config_dhcp_clients_enabled += client
endif
if (client == 'dhclient')
dhcp_summary += ' (deprecated)'
endif
dhcp_summary += '\n'
endforeach
@@ -712,6 +726,7 @@ default_paths = ['/sbin', '/usr/sbin']
# 0: cmdline option, 1: paths, 2: fallback
progs = [['iptables', default_paths, '/usr/sbin/iptables'],
['ip6tables', default_paths, '/usr/sbin/ip6tables'],
['nft', default_paths, '/usr/sbin/nft'],
['dnsmasq', default_paths, ''],
['modprobe', default_paths, '/sbin/modprobe']
@@ -798,8 +813,10 @@ endif
enable_nm_cloud_setup = get_option('nm_cloud_setup')
if enable_nm_cloud_setup
assert(libcurl_dep.found(), 'nm-cloud-setup requires libcurl library. Use -Dnm_cloud_setup=false to disable it')
assert(jansson_dep.found(), 'nm-cloud-setup requires jansson library. Use -Dnm_cloud_setup=false to disable it')
endif
enable_man = get_option('man')
enable_docs = get_option('docs')
more_asserts = get_option('more_asserts')
@@ -916,6 +933,14 @@ if python.found()
config_h.set_quoted('TEST_NM_PYTHON', python_path)
endif
# libnvme (NBFT support)
enable_nbft = get_option('nbft')
if enable_nbft
libnvme_dep = dependency('libnvme', version: '>= 1.5', required: false)
assert(libnvme_dep.found(), 'NBFT support was requested, but the libnvme library is not available. Use -Dnbft=false to build without it.')
endif
config_h.set10('WITH_NBFT', enable_nbft)
data_conf = configuration_data()
data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : ''))
data_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit)
@@ -925,6 +950,7 @@ data_conf.set('NM_CONFIG_DEFAULT_MAIN_DHCP', config_dhcp_default)
data_conf.set('NM_CONFIG_DEFAULT_MAIN_RC_MANAGER', config_dns_rc_manager_default)
data_conf.set('NM_CONFIG_DEFAULT_MAIN_MIGRATE_IFCFG_RH_TEXT', config_migrate_ifcfg_rh_default)
data_conf.set('NM_CONFIG_DEFAULT_WIFI_BACKEND_TEXT', config_wifi_backend_default)
data_conf.set('NM_DHCP_CLIENTS_ENABLED', ', '.join(config_dhcp_clients_enabled))
data_conf.set('NM_MAJOR_VERSION', nm_major_version)
data_conf.set('NM_MICRO_VERSION', nm_micro_version)
data_conf.set('NM_MINOR_VERSION', nm_minor_version)
@@ -939,38 +965,6 @@ data_conf.set('nmstatedir', nm_pkgstatedir)
data_conf.set('sbindir', nm_sbindir)
data_conf.set('sysconfdir', nm_sysconfdir)
# check if we can build setting property documentation
'''
build_docs=no
if test -n "$INTROSPECTION_MAKEFILE"; then
# If g-i is installed we know we have python, but we might not have pygobject
if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then
AC_MSG_ERROR(["--enable-introspection aims to build the settings documentation. This requires GObject introspection for python (pygobject)])
fi
AC_PATH_PROG(PERL, perl)
if test -z "$PERL"; then
AC_MSG_ERROR([--enable-introspection requires perl])
fi
AC_PATH_PROG(XSLTPROC, xsltproc)
if test -z "$XSLTPROC"; then
AC_MSG_ERROR([--enable-introspection requires xsltproc])
fi
have_introspection=yes
if test "$enable_gtk_doc" = "yes"; then
build_docs=yes
fi
else
if test "$enable_gtk_doc" = "yes"; then
# large parts of the documentation require introspection/pygobject to extract
# the documentation out of the source files. You cannot enable gtk-doc without alone.
AC_MSG_ERROR(["--with-gtk-doc requires --enable-introspection"])
fi
have_introspection=no
fi
'''
content_files = []
subdir('introspection')
@@ -1008,9 +1002,14 @@ if enable_qt != 'false'
endif
endif
# The man/ directory builds a couple targets needed by the docs build too.
# If we build with docs but no man, then enter the subdir and only build
# some targets.
if enable_docs or enable_man
subdir('man')
endif
if enable_docs
assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true')
subdir('man')
subdir('docs')
meson.add_dist_script(
'tools/meson-dist-data.sh',
@@ -1061,7 +1060,7 @@ meson.add_install_script(
nm_pkgstatedir,
nm_mandir,
nm_sysconfdir,
enable_docs ? '1' : '0',
enable_man ? '1' : '0',
enable_ifcfg_rh ? '1' : '0',
enable_nm_cloud_setup ? '1' : '0',
install_systemdunitdir ? '1' : '0',
@@ -1112,6 +1111,7 @@ endif
output += '\n'
output += ' jansson: ' + jansson_msg + '\n'
output += ' iptables: ' + config_h.get('IPTABLES_PATH') + '\n'
output += ' ip6tables: ' + config_h.get('IP6TABLES_PATH') + '\n'
output += ' nft: ' + config_h.get('NFT_PATH') + '\n'
output += ' modprobe: ' + config_h.get('MODPROBE_PATH') + '\n'
output += ' modemmanager-1: ' + enable_modem_manager.to_string() + '\n'
@@ -1126,7 +1126,7 @@ output += ' nmcli: ' + enable_nmcli.to_string() + '\n'
output += ' nmtui: ' + enable_nmtui.to_string() + '\n'
output += ' nm-cloud-setup: ' + enable_nm_cloud_setup.to_string() + '\n'
output += '\nConfiguration_plugins (main.plugins=' + config_plugins_default + ')\n'
output += ' ifcfg-rh: ' + enable_ifcfg_rh.to_string() + '\n'
output += ' ifcfg-rh: ' + enable_ifcfg_rh.to_string() + ' (deprecated)\n'
output += ' default value of main.migrate-ifcfg-rh: ' + config_migrate_ifcfg_rh_default + '\n'
output += ' ifupdown: ' + enable_ifupdown.to_string() + '\n'
output += '\nHandlers for /etc/resolv.conf:\n' + resolv_conf_summary

View File

@@ -6,6 +6,7 @@ option('dbus_conf_dir', type: 'string', value: '', description: 'where D-Bus sys
option('kernel_firmware_dir', type: 'string', value: '/lib/firmware', description: 'where kernel firmware directory is (default is /lib/firmware)')
option('runtime_dir', type: 'string', value: '', description: 'Directory for transient runtime state [default: LOCALSTATEDIR/run or /run]')
option('iptables', type: 'string', value: '', description: 'path to iptables')
option('ip6tables', type: 'string', value: '', description: 'path to ip6tables')
option('nft', type: 'string', value: '', description: 'path to nft')
option('dnsmasq', type: 'string', value: '', description: 'path to dnsmasq')
option('modprobe', type: 'string', value: '', description: 'path to modprobe')
@@ -44,6 +45,7 @@ option('nmtui', type: 'boolean', value: true, description: 'Build nmtui')
option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud')
option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support')
option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support')
option('nbft', type: 'boolean', value: true, description: 'Enable NBFT support in the initrd generator')
# configuration plugins
option('config_plugins_default', type: 'string', value: '', description: 'Default configuration option for main.plugins setting, used as fallback if the configuration option is unset')
@@ -57,15 +59,15 @@ option('netconfig', type: 'string', value: '', description: 'Enable SUSE netconf
option('config_dns_rc_manager_default', type: 'combo', choices: ['auto', 'symlink', 'file', 'netconfig', 'resolvconf'], value: 'auto', description: 'Configure default value for main.rc-manager setting')
# dhcp clients
option('dhclient', type: 'string', value: '', description: 'Enable dhclient support')
option('dhcpcanon', type: 'string', value: '', description: 'Enable dhcpcanon support (experimental)')
option('dhclient', type: 'string', value: 'no', description: 'Enable dhclient support (deprecated)')
option('dhcpcd', type: 'string', value: '', description: 'Enable dhcpcd support')
option('config_dhcp_default', type: 'combo', choices: ['dhcpcanon', 'dhclient', 'dhcpcd', 'internal', 'nettools'], value: 'internal', description: 'Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset')
option('config_dhcp_default', type: 'combo', choices: ['dhclient', 'dhcpcd', 'internal', 'nettools'], value: 'internal', description: 'Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset')
# miscellaneous
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
option('vapi', type : 'combo', choices : ['auto', 'true', 'false'], description: 'build Vala bindings')
option('docs', type: 'boolean', value: false, description: 'use to build documentation')
option('man', type: 'boolean', value: true, description: 'Install manpages')
option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests')
option('firewalld_zone', type: 'boolean', value: true, description: 'Install and use firewalld zone for shared mode')
option('more_asserts', type: 'string', value: 'auto', description: 'Enable more assertions for debugging (0 = no, 100 = all, default: auto)')

View File

@@ -95,6 +95,7 @@ src/libnm-core-impl/nm-setting-hsr.c
src/libnm-core-impl/nm-setting-infiniband.c
src/libnm-core-impl/nm-setting-ip-config.c
src/libnm-core-impl/nm-setting-ip-tunnel.c
src/libnm-core-impl/nm-setting-ipvlan.c
src/libnm-core-impl/nm-setting-ip4-config.c
src/libnm-core-impl/nm-setting-ip6-config.c
src/libnm-core-impl/nm-setting-loopback.c
@@ -148,6 +149,7 @@ src/libnmc-base/nm-secret-agent-simple.c
src/libnmc-base/nm-vpn-helpers.c
src/libnmc-setting/nm-meta-setting-access.c
src/libnmc-setting/nm-meta-setting-desc.c
src/libnmc-setting/nm-meta-setting-desc.h
src/libnmc-setting/settings-docs.h.in
src/libnmt-newt/nmt-newt-utils.c
src/nm-online/nm-online.c
@@ -179,10 +181,12 @@ src/nmtui/nmt-page-infiniband.c
src/nmtui/nmt-page-ip-tunnel.c
src/nmtui/nmt-page-ip4.c
src/nmtui/nmt-page-ip6.c
src/nmtui/nmt-page-loopback.c
src/nmtui/nmt-page-macsec.c
src/nmtui/nmt-page-ppp.c
src/nmtui/nmt-page-team-port.c
src/nmtui/nmt-page-team.c
src/nmtui/nmt-page-veth.c
src/nmtui/nmt-page-vlan.c
src/nmtui/nmt-page-wifi.c
src/nmtui/nmt-page-wireguard.c

View File

@@ -1,20 +1,11 @@
contrib/fedora/rpm/
data/NetworkManager-dispatcher.service.in
data/NetworkManager-wait-online.service.in
data/NetworkManager-wait-online-initrd.service.in
data/NetworkManager-initrd.service.in
data/NetworkManager.service.in
data/nm-priv-helper.service.in
data/org.freedesktop.NetworkManager.policy.in
examples/python/NetworkManager.py
examples/python/systray/eggtrayicon.c
src/contrib/nm-vpn-editor-plugin-call.h
src/contrib/nm-vpn-plugin-utils.c
src/libnm-systemd-shared/src/basic/parse-util.c
src/nm-cloud-setup/nm-cloud-setup.service.in
vpn-daemons/openvpn
vpn-daemons/pptp
vpn-daemons/vpnc
# https://bugs.launchpad.net/intltool/+bug/1117944
sub/data/org.freedesktop.NetworkManager.policy.in
# from meson build directory:
build/data/org.freedesktop.NetworkManager.policy.in

7951
po/de.po

File diff suppressed because it is too large Load Diff

5686
po/ka.po

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
i18n.gettext(nm_name, preset: 'glib')
test(
'check-potfile-list',
find_program(join_paths(source_root, 'src/tests/check-potfile-list.py'))
)

7371
po/ru.po

File diff suppressed because it is too large Load Diff

13999
po/sl.po

File diff suppressed because it is too large Load Diff

View File

@@ -3341,8 +3341,8 @@ msgstr "Förväntat värde av typen \"aa{sv}\""
#: src/libnm-core-impl/nm-utils.c:2359
#, c-format
msgid "IP address requires fields \"dest\" and \"prefix\" (idx=%u)"
msgstr "IP-adressen kräver fälten \"dest\" och \"prefix\" (idx=%u)"
msgid "IP address requires fields \"address\" and \"prefix\" (idx=%u)"
msgstr "IP-adressen kräver fälten \"address\" och \"prefix\" (idx=%u)"
#: src/libnm-core-impl/nm-utils.c:2538
#, c-format

View File

@@ -3428,7 +3428,7 @@ msgstr "'%s', '%s' için geçerli bir değer değil"
#: src/libnm-core-impl/nm-utils.c:2359
#, c-format
msgid "IP address requires fields \"dest\" and \"prefix\" (idx=%u)"
msgid "IP address requires fields \"address\" and \"prefix\" (idx=%u)"
msgstr ""
#: src/libnm-core-impl/nm-utils.c:2538

View File

@@ -11,7 +11,7 @@
*
* This uses the NMVpnEditorPluginVT and allows a user (nm-applet)
* to directly communicate with a VPN plugin using API that is newer
* then the current libnm version. That is, it allows to call to a VPN
* then the current libnm version. That is, it allows a user to call to a VPN
* plugin bypassing libnm. */
#include <NetworkManager.h>

View File

@@ -11,8 +11,47 @@
/*****************************************************************************/
char *
nm_vpn_plugin_utils_get_editor_module_path(const char *module_name, GError **error)
{
gs_free char *module_path = NULL;
gs_free char *dirname = NULL;
Dl_info plugin_info;
g_return_val_if_fail(module_name, NULL);
g_return_val_if_fail(!error || !*error, NULL);
/*
* Look for the editor from the same directory this plugin is in.
* Ideally, we'd get our .so name from the NMVpnEditorPlugin if it
* would just have a property with it...
*/
if (!dladdr(nm_vpn_plugin_utils_load_editor, &plugin_info)) {
/* Really a "can not happen" scenario. */
g_set_error(error,
NM_VPN_PLUGIN_ERROR,
NM_VPN_PLUGIN_ERROR_FAILED,
_("unable to get editor plugin name: %s"),
dlerror());
}
dirname = g_path_get_dirname(plugin_info.dli_fname);
module_path = g_build_filename(dirname, module_name, NULL);
if (!g_file_test(module_path, G_FILE_TEST_EXISTS)) {
g_set_error(error,
G_FILE_ERROR,
G_FILE_ERROR_NOENT,
_("missing plugin file \"%s\""),
module_path);
return NULL;
}
return g_steal_pointer(&module_path);
}
NMVpnEditor *
nm_vpn_plugin_utils_load_editor(const char *module_name,
nm_vpn_plugin_utils_load_editor(const char *module_path,
const char *factory_name,
NMVpnPluginUtilsEditorFactory editor_factory,
NMVpnEditorPlugin *editor_plugin,
@@ -21,48 +60,36 @@ nm_vpn_plugin_utils_load_editor(const char *module_name,
GError **error)
{
gs_free char *compat_module_path = NULL;
static struct {
gpointer factory;
void *dl_module;
char *module_name;
char *module_path;
char *factory_name;
} cached = {0};
NMVpnEditor *editor;
gs_free char *module_path = NULL;
gs_free char *dirname = NULL;
Dl_info plugin_info;
NMVpnEditor *editor;
g_return_val_if_fail(module_name, NULL);
g_return_val_if_fail(module_path, NULL);
g_return_val_if_fail(factory_name && factory_name[0], NULL);
g_return_val_if_fail(editor_factory, NULL);
g_return_val_if_fail(NM_IS_VPN_EDITOR_PLUGIN(editor_plugin), NULL);
g_return_val_if_fail(NM_IS_CONNECTION(connection), NULL);
g_return_val_if_fail(!error || !*error, NULL);
if (!g_path_is_absolute(module_name)) {
/*
* Load an editor from the same directory this plugin is in.
* Ideally, we'd get our .so name from the NMVpnEditorPlugin if it
* would just have a property with it...
*/
if (!dladdr(nm_vpn_plugin_utils_load_editor, &plugin_info)) {
/* Really a "can not happen" scenario. */
g_set_error(error,
NM_VPN_PLUGIN_ERROR,
NM_VPN_PLUGIN_ERROR_FAILED,
_("unable to get editor plugin name: %s"),
dlerror());
}
dirname = g_path_get_dirname(plugin_info.dli_fname);
module_path = g_build_filename(dirname, module_name, NULL);
} else {
module_path = g_strdup(module_name);
if (!g_path_is_absolute(module_path)) {
/* This presumably means the VPN plugin factory() didn't verify that the plugin is there.
* Now it might be too late to do so. */
g_warning("VPN plugin bug: load_editor() argument not an absolute path. Continuing...");
compat_module_path = nm_vpn_plugin_utils_get_editor_module_path(module_path, error);
if (compat_module_path == NULL)
return NULL;
else
module_path = compat_module_path;
}
/* we really expect this function to be called with unchanging @module_name
/* we really expect this function to be called with unchanging @module_path
* and @factory_name. And we only want to load the module once, hence it would
* be more complicated to accept changing @module_name/@factory_name arguments.
* be more complicated to accept changing @module_path/@factory_name arguments.
*
* The reason for only loading once is that due to glib types, we cannot create a
* certain type-name more then once, so loading the same module or another version
@@ -70,12 +97,12 @@ nm_vpn_plugin_utils_load_editor(const char *module_name,
* name.
*
* Only support loading once, any future calls will reuse the handle. To simplify
* that, we enforce that the @factory_name and @module_name is the same. */
* that, we enforce that the @factory_name and @module_path is the same. */
if (cached.factory) {
g_return_val_if_fail(cached.dl_module, NULL);
g_return_val_if_fail(cached.factory_name && nm_streq0(cached.factory_name, factory_name),
NULL);
g_return_val_if_fail(cached.module_name && nm_streq0(cached.module_name, module_name),
g_return_val_if_fail(cached.module_path && nm_streq0(cached.module_path, module_path),
NULL);
} else {
gpointer factory;
@@ -83,14 +110,6 @@ nm_vpn_plugin_utils_load_editor(const char *module_name,
dl_module = dlopen(module_path, RTLD_LAZY | RTLD_LOCAL);
if (!dl_module) {
if (!g_file_test(module_path, G_FILE_TEST_EXISTS)) {
g_set_error(error,
G_FILE_ERROR,
G_FILE_ERROR_NOENT,
_("missing plugin file \"%s\""),
module_path);
return NULL;
}
g_set_error(error,
NM_VPN_PLUGIN_ERROR,
NM_VPN_PLUGIN_ERROR_FAILED,
@@ -117,7 +136,7 @@ nm_vpn_plugin_utils_load_editor(const char *module_name,
* Thus we just leak the dl_module handle indefinitely. */
cached.factory = factory;
cached.dl_module = dl_module;
cached.module_name = g_strdup(module_name);
cached.module_path = g_strdup(module_path);
cached.factory_name = g_strdup(factory_name);
}
@@ -136,3 +155,33 @@ nm_vpn_plugin_utils_load_editor(const char *module_name,
g_return_val_if_fail(NM_IS_VPN_EDITOR(editor), NULL);
return editor;
}
char *
nm_vpn_plugin_utils_get_cert_path(const char *plugin)
{
const char *path;
g_return_val_if_fail(plugin, NULL);
/* Users can set NM_CERT_PATH=~/.cert to be compatible with the certificate
* directory used in the past. */
path = g_getenv("NM_CERT_PATH");
if (path)
return g_build_filename(path, plugin, NULL);
/* Otherwise use XDG_DATA_HOME. We use subdirectory "networkmanagement/certificates"
* because the SELinux policy already has rules to set the correct labels in that
* directory. */
path = g_getenv("XDG_DATA_HOME");
if (path)
return g_build_filename(path, "networkmanagement", "certificates", plugin, NULL);
/* Use the default value for XDG_DATA_HOME */
return g_build_filename(g_get_home_dir(),
".local",
"share",
"networkmanagement",
"certificates",
plugin,
NULL);
}

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2016 Red Hat, Inc.
* Copyright (C) 2016,2024 Red Hat, Inc.
*/
#ifndef __NM_VPN_PLUGIN_UTILS_H__
@@ -14,7 +14,9 @@ typedef NMVpnEditor *(NMVpnPluginUtilsEditorFactory) (gpointer factory
gpointer user_data,
GError **error);
NMVpnEditor *nm_vpn_plugin_utils_load_editor(const char *module_name,
char *nm_vpn_plugin_utils_get_editor_module_path(const char *module_name, GError **error);
NMVpnEditor *nm_vpn_plugin_utils_load_editor(const char *module_path,
const char *factory_name,
NMVpnPluginUtilsEditorFactory editor_factory,
NMVpnEditorPlugin *editor_plugin,
@@ -22,4 +24,6 @@ NMVpnEditor *nm_vpn_plugin_utils_load_editor(const char *modul
gpointer user_data,
GError **error);
char *nm_vpn_plugin_utils_get_cert_path(const char *plugin);
#endif /* __NM_VPN_PLUGIN_UTILS_H__ */

View File

@@ -250,23 +250,19 @@ nm_utils_ppp_ip_methods_enabled(NMConnection *connection,
/*****************************************************************************/
void
_nm_utils_complete_generic_with_params(NMPlatform *platform,
NMConnection *connection,
const char *ctype,
NMConnection *const *existing_connections,
const char *preferred_id,
const char *fallback_id_prefix,
const char *ifname_prefix,
const char *ifname,
...)
nm_utils_complete_generic(NMPlatform *platform,
NMConnection *connection,
const char *ctype,
NMConnection *const *existing_connections,
const char *preferred_id,
const char *fallback_id_prefix,
const char *ifname_prefix,
const char *ifname)
{
NMSettingConnection *s_con;
char *id;
char *generated_ifname;
gs_unref_hashtable GHashTable *parameters = NULL;
va_list ap;
const char *p_val;
const char *p_key;
g_assert(fallback_id_prefix);
g_return_if_fail(ifname_prefix == NULL || ifname == NULL);
@@ -301,20 +297,22 @@ _nm_utils_complete_generic_with_params(NMPlatform *platform,
g_free(generated_ifname);
}
/* Normalize */
va_start(ap, ifname);
while ((p_key = va_arg(ap, const char *))) {
p_val = va_arg(ap, const char *);
if (!p_val) {
if (parameters)
g_hash_table_remove(parameters, p_key);
continue;
}
if (!parameters)
parameters = g_hash_table_new(nm_str_hash, g_str_equal);
g_hash_table_insert(parameters, (char *) p_key, (char *) p_val);
if (nm_connection_get_setting_adsl(connection) || nm_connection_get_setting_cdma(connection)
|| nm_connection_get_setting_olpc_mesh(connection)
|| nm_connection_get_setting_pppoe(connection)
|| nm_connection_get_setting_vpn(connection)) {
parameters = g_hash_table_new(nm_str_hash, g_str_equal);
g_hash_table_insert(parameters,
NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD,
NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
} else {
parameters = NULL;
}
va_end(ap);
/* We ignore the result, because the caller validates the connection.
* The only reason we do a normalization attempt here is
* NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD.
* Could we perhaps, one day, get rid of it? */
nm_connection_normalize(connection, parameters, NULL, NULL);
}
@@ -967,7 +965,7 @@ nm_match_spec_device_data_init_from_device(struct _NMMatchSpecDeviceData *out_da
nm_assert(out_data);
if (!device) {
*out_data = (NMMatchSpecDeviceData){};
*out_data = (NMMatchSpecDeviceData) {};
return out_data;
}
@@ -983,7 +981,7 @@ nm_match_spec_device_data_init_from_device(struct _NMMatchSpecDeviceData *out_da
*
* The returned data is only valid, until NMDevice gets modified again. */
*out_data = (NMMatchSpecDeviceData){
*out_data = (NMMatchSpecDeviceData) {
.interface_name = nm_device_get_iface(device),
.device_type = nm_device_get_type_description(device),
.driver = nm_device_get_driver(device),
@@ -1010,7 +1008,7 @@ nm_match_spec_device_data_init_from_platform(NMMatchSpecDeviceData *out_data,
* It's still useful because of specs like "*" and "except:interface-name:eth0",
* which match even in that case. */
*out_data = (NMMatchSpecDeviceData){
*out_data = (NMMatchSpecDeviceData) {
.interface_name = pllink ? pllink->name : NULL,
.device_type = match_device_type,
.driver = pllink ? pllink->driver : NULL,
@@ -1057,7 +1055,7 @@ nm_ip_routing_rule_to_platform(const NMIPRoutingRule *rule, NMPlatformRoutingRul
uid_range_has = nm_ip_routing_rule_get_uid_range(rule, &uid_range_start, &uid_range_end);
*out_pl = (NMPlatformRoutingRule){
*out_pl = (NMPlatformRoutingRule) {
.addr_family = nm_ip_routing_rule_get_addr_family(rule),
.flags = (nm_ip_routing_rule_get_invert(rule) ? FIB_RULE_INVERT : 0),
.priority = nm_ip_routing_rule_get_priority(rule),
@@ -1200,7 +1198,7 @@ nm_shutdown_wait_obj_register_full(gpointer watched_obj,
* make sure to use the default context. */
handle = g_slice_new(NMShutdownWaitObjHandle);
*handle = (NMShutdownWaitObjHandle){
*handle = (NMShutdownWaitObjHandle) {
/* depending on @free_msg_reason, we take ownership of @msg_reason.
* In either case, we just reference the string without cloning
* it. */
@@ -1511,7 +1509,6 @@ nm_utils_ip_route_attribute_to_platform(int addr_family,
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_INITCWND, r->initcwnd, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_INITRWND, r->initrwnd, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_MTU, r->mtu, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_RTO_MIN, r->rto_min, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_QUICKACK, r->quickack, BOOLEAN, boolean, FALSE);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_WINDOW, r->lock_window, BOOLEAN, boolean, FALSE);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_CWND, r->lock_cwnd, BOOLEAN, boolean, FALSE);
@@ -1520,6 +1517,18 @@ nm_utils_ip_route_attribute_to_platform(int addr_family,
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_MTU, r->lock_mtu, BOOLEAN, boolean, FALSE);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_ADVMSS, r->lock_mss, BOOLEAN, boolean, FALSE);
{
GVariant *_variant = nm_ip_route_get_attribute(s_route, NM_IP_ROUTE_ATTRIBUTE_RTO_MIN);
if (_variant && g_variant_is_of_type(_variant, G_VARIANT_TYPE_UINT32)) {
r->rto_min = g_variant_get_uint32(_variant);
r->rto_min_set = TRUE;
} else {
r->rto_min = 0;
r->rto_min_set = FALSE;
}
}
if ((variant = nm_ip_route_get_attribute(s_route, NM_IP_ROUTE_ATTRIBUTE_SRC))
&& g_variant_is_of_type(variant, G_VARIANT_TYPE_STRING)) {
if (inet_pton(addr_family, g_variant_get_string(variant, NULL), &addr) == 1) {

View File

@@ -23,60 +23,14 @@ void nm_utils_ppp_ip_methods_enabled(NMConnection *connection,
gboolean *out_ip4_enabled,
gboolean *out_ip6_enabled);
void _nm_utils_complete_generic_with_params(NMPlatform *platform,
NMConnection *connection,
const char *ctype,
NMConnection *const *existing_connections,
const char *preferred_id,
const char *fallback_id_prefix,
const char *ifname_prefix,
const char *ifname,
...) G_GNUC_NULL_TERMINATED;
#define nm_utils_complete_generic_with_params(platform, \
connection, \
ctype, \
existing_connections, \
preferred_id, \
fallback_id_prefix, \
ifname_prefix, \
ifname, \
...) \
_nm_utils_complete_generic_with_params(platform, \
connection, \
ctype, \
existing_connections, \
preferred_id, \
fallback_id_prefix, \
ifname_prefix, \
ifname, \
##__VA_ARGS__, \
NULL)
static inline void
nm_utils_complete_generic(NMPlatform *platform,
NMConnection *connection,
const char *ctype,
NMConnection *const *existing_connections,
const char *preferred_id,
const char *fallback_id_prefix,
const char *ifname_prefix,
const char *ifname,
gboolean default_enable_ipv6)
{
nm_utils_complete_generic_with_params(platform,
connection,
ctype,
existing_connections,
preferred_id,
fallback_id_prefix,
ifname_prefix,
ifname,
NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD,
default_enable_ipv6
? NM_SETTING_IP6_CONFIG_METHOD_AUTO
: NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
}
void nm_utils_complete_generic(NMPlatform *platform,
NMConnection *connection,
const char *ctype,
NMConnection *const *existing_connections,
const char *preferred_id,
const char *fallback_id_prefix,
const char *ifname_prefix,
const char *ifname);
typedef gboolean(NMUtilsMatchFilterFunc)(NMConnection *connection, gpointer user_data);

View File

@@ -117,8 +117,7 @@ complete_connection(NMDevice *device,
NULL,
_("ADSL connection"),
NULL,
NULL,
FALSE); /* No IPv6 yet by default */
NULL);
return TRUE;
}
@@ -494,7 +493,7 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
_LOGD(LOGD_ADSL, "starting PPPoA");
}
priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig){
priv->ppp_mgr = nm_ppp_mgr_start(&((const NMPppMgrConfig) {
.netns = nm_device_get_netns(device),
.parent_iface = ppp_iface,
.callback = _ppp_mgr_callback,

View File

@@ -334,7 +334,7 @@ _bz_dbus_obj_new(NMBluezManager *self, const char *object_path)
l = strlen(object_path) + 1;
bzobj = g_malloc(sizeof(BzDBusObj) + l);
*bzobj = (BzDBusObj){
*bzobj = (BzDBusObj) {
.object_path = bzobj->_object_path_intern,
.self = self,
.x_network_server.lst = C_LIST_INIT(bzobj->x_network_server.lst),
@@ -751,7 +751,7 @@ _conn_data_head_new(NMBluetoothCapabilities bt_type, const char *bdaddr)
l = strlen(bdaddr) + 1;
cdata_hd = g_malloc(sizeof(ConnDataHead) + l);
*cdata_hd = (ConnDataHead){
*cdata_hd = (ConnDataHead) {
.bdaddr = cdata_hd->bdaddr_data,
.lst_head = C_LIST_INIT(cdata_hd->lst_head),
.bt_type = bt_type,
@@ -1143,7 +1143,7 @@ _network_server_vt_register_bridge(const NMBtVTableNetworkServer *vtable,
bzobj->d_adapter.address);
r_req_data = g_slice_new(NetworkServerRegisterReqData);
*r_req_data = (NetworkServerRegisterReqData){
*r_req_data = (NetworkServerRegisterReqData) {
.int_cancellable = g_cancellable_new(),
.ext_cancellable = g_object_ref(cancellable),
.callback = callback,
@@ -2749,7 +2749,7 @@ nm_bluez_manager_connect(NMBluezManager *self,
}
c_req_data = g_slice_new(DeviceConnectReqData);
*c_req_data = (DeviceConnectReqData){
*c_req_data = (DeviceConnectReqData) {
.int_cancellable = g_steal_pointer(&int_cancellable),
.ext_cancellable = g_object_ref(cancellable),
.callback = callback,
@@ -2814,7 +2814,7 @@ nm_bluez_manager_init(NMBluezManager *self)
{
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE(self);
priv->vtable_network_server = (NMBtVTableNetworkServer){
priv->vtable_network_server = (NMBtVTableNetworkServer) {
.is_available = _network_server_vt_is_available,
.register_bridge = _network_server_vt_register_bridge,
.unregister_bridge = _network_server_vt_unregister_bridge,

Some files were not shown because too many files have changed in this diff Show More