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.
This commit is contained in:
Wen Liang
2025-06-22 16:03:57 -04:00
parent e26e965134
commit 6a13e8d369
2 changed files with 6 additions and 1 deletions

View File

@@ -478,7 +478,8 @@ _version_info_get(void)
* Each of the array's elements has 32 bits. This means that capabilities
* with index 0-31 goes to element #1, with index 32-63 to element #2,
* with index 64-95 to element #3 and so on. */
1 << NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE,
(1 << NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE)
| (1 << NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING),
};
return nm_g_variant_new_au(arr, G_N_ELEMENTS(arr));

View File

@@ -100,6 +100,9 @@
* https://issues.redhat.com/browse/RHEL-66262
* https://issues.redhat.com/browse/RHEL-67324
*
* @NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING: Indicates that NetworkManager supports
* configuring per-device IPv4 sysctl forwarding setting. Since: 1.56.
*
* The numeric values represent the bit index of the capability. These capabilities
* can be queried in the "VersionInfo" D-Bus property.
*
@@ -107,6 +110,7 @@
*/
typedef enum {
NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE = 0,
NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING = 1,
} NMVersionInfoCapability;
/**