NetworkManager/src/core/settings
Thomas Haller 3cd02b6ed6
libnm,platform: fix range for "weight" property of next hops for routes
In kernel, the valid range for the weight is 1-256 (on netlink this is
expressed as u8 in rtnh_hops, ranging 0-255).

We need an additional value, to represent

- unset weight, for non-ECMP routes in kernel.

- in libnm API, to express routes that should not be merged as ECMP
  routes (the default).

Extend the type in NMPlatformIP4Route.weight to u16, and fix the code
for the special handling of the numeric range.

Also the libnm API needs to change. Modify the type of the attribute on
D-Bus from "b" to "u", to use a 32 bit integer. We use 32 bit, because
we already have common code to handle 32 bit unsigned integers, despite
only requiring 257 values. It seems better to stick to a few data types
(u32) instead of introducing more, only because the range is limited.

Co-Authored-By: Fernando Fernandez Mancera <ffmancera@riseup.net>

Fixes: 1bbdecf5e1 ('platform: manage ECMP routes')
2023-01-17 14:05:13 +01:00
..
plugins libnm,platform: fix range for "weight" property of next hops for routes 2023-01-17 14:05:13 +01:00
nm-agent-manager.c style: various minor adjustments 2022-10-25 08:41:45 +02:00
nm-agent-manager.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-secret-agent.c core: use NM_SHUTDOWN_TIMEOUT_1500_MSEC 2022-02-24 09:38:53 +01:00
nm-secret-agent.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-settings-connection.c settings-connection: add a "plugin" argument to Update2() 2022-03-28 13:29:28 +02:00
nm-settings-connection.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-settings-plugin.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-plugin.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-settings-storage.c all: use nm_uuid_is_normalized() for checking valid UUID for "connection.uuid" 2021-06-04 09:29:23 +02:00
nm-settings-storage.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00
nm-settings-utils.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-utils.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-settings.c hostname: rename nm_hostname_manager_write_hostname() to set_static_hostname() 2022-10-27 15:18:54 +02:00
nm-settings.h all: use _NM_G_TYPE_CHECK_INSTANCE_CAST() for internal uses 2022-12-16 10:55:03 +01:00