NetworkManager/src/libnm-core-impl/tests
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
..
certs crypto: support EC private keys 2022-08-04 09:46:06 +02:00
meson.build build: fix linking libnm-log-null into different test programs 2021-07-05 14:51:27 +02:00
nm-core-tests-enum-types.c.template build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00
nm-core-tests-enum-types.h.template build: move "libnm-core/" to "src/" and split it 2021-02-18 19:46:51 +01:00
test-compare.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
test-crypto.c crypto: support EC private keys 2022-08-04 09:46:06 +02:00
test-general-enums.h all: adjust glib-mkenums annotations for automated formatting 2022-02-08 11:14:01 +01:00
test-general.c libnm,platform: fix range for "weight" property of next hops for routes 2023-01-17 14:05:13 +01:00
test-keyfile.c keyfile: don't require verified profile in nm_keyfile_write() 2022-03-28 18:27:37 +02:00
test-secrets.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
test-setting.c ovs: add support for "other_config" settings 2023-01-11 21:49:36 +01:00
test-settings-defaults.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00