1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Netlink: Cleanups in route metrics

- Add krt_fastopen_no_cookie atttibute
- Add missing krt_lock_* bits
- Fix krt_feature_allfrag
- Fix type of EA_KRT_LOCK and EA_KRT_FEATURES
This commit is contained in:
Ondrej Zajicek
2024-02-16 14:29:54 +01:00
parent 225943eaea
commit e68363909c
4 changed files with 33 additions and 10 deletions

View File

@@ -1840,7 +1840,15 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h)
for (t = 1; t < KRT_METRICS_MAX; t++)
if (metrics[0] & (1 << t))
if (t == RTAX_CC_ALGO)
if ((t == RTAX_LOCK) || (t == RTAX_FEATURES))
{
ea->attrs[n++] = (eattr) {
.id = EA_KRT_METRICS + t,
.type = EAF_TYPE_BITFIELD,
.u.data = metrics[t],
};
}
else if (t == RTAX_CC_ALGO)
{
struct adata *ad = lp_alloc_adata(s->pool, strlen(cc_algo));
memcpy(ad->data, cc_algo, ad->length);
@@ -1855,7 +1863,7 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h)
{
ea->attrs[n++] = (eattr) {
.id = EA_KRT_METRICS + t,
.type = EAF_TYPE_INT, /* FIXME: Some are EAF_TYPE_BITFIELD */
.type = EAF_TYPE_INT,
.u.data = metrics[t],
};
}
@@ -2142,7 +2150,7 @@ krt_sys_copy_config(struct krt_config *d, struct krt_config *s)
static const char *krt_metrics_names[KRT_METRICS_MAX] = {
NULL, "lock", "mtu", "window", "rtt", "rttvar", "sstresh", "cwnd", "advmss",
"reordering", "hoplimit", "initcwnd", "features", "rto_min", "initrwnd", "quickack",
"congctl"
"congctl", "fastopen_no_cookie"
};
static const char *krt_features_names[KRT_FEATURES_MAX] = {