platform: always set the lock flag for RTO_MIN

The rto-min value is ignored by kernel unless the lock flag is set.
This commit is contained in:
Beniamino Galvani
2025-04-03 16:04:09 +02:00
parent 2b922a93a5
commit 6478e5158a
2 changed files with 16 additions and 9 deletions

View File

@@ -4291,7 +4291,7 @@ rta_multipath_done:
initrwnd = nla_get_u32(mtb[RTAX_INITRWND]);
if (mtb[RTAX_MTU])
mtu = nla_get_u32(mtb[RTAX_MTU]);
if (mtb[RTAX_RTO_MIN]) {
if (mtb[RTAX_RTO_MIN] && NM_FLAGS_HAS(lock, 1U << RTAX_RTO_MIN)) {
rto_min = nla_get_u32(mtb[RTAX_RTO_MIN]);
rto_min_set = TRUE;
}
@@ -5638,12 +5638,19 @@ nla_put_failure:
static guint32
ip_route_get_lock_flag(const NMPlatformIPRoute *route)
{
return (((guint32) route->lock_window) << RTAX_WINDOW)
| (((guint32) route->lock_cwnd) << RTAX_CWND)
| (((guint32) route->lock_initcwnd) << RTAX_INITCWND)
| (((guint32) route->lock_initrwnd) << RTAX_INITRWND)
| (((guint32) route->lock_mtu) << RTAX_MTU)
| (((guint32) route->lock_mss) << RTAX_ADVMSS);
guint32 ret;
ret = (((guint32) route->lock_window) << RTAX_WINDOW)
| (((guint32) route->lock_cwnd) << RTAX_CWND)
| (((guint32) route->lock_initcwnd) << RTAX_INITCWND)
| (((guint32) route->lock_initrwnd) << RTAX_INITRWND)
| (((guint32) route->lock_mtu) << RTAX_MTU)
| (((guint32) route->lock_mss) << RTAX_ADVMSS);
/* the rto-min value is ignored by kernel unless the lock flag is set */
ret |= (((guint32) route->rto_min_set) << RTAX_RTO_MIN);
return ret;
}
static gboolean

View File

@@ -314,7 +314,7 @@ guint _nm_platform_signal_id_get(NMPlatformSignalIdType signal_type);
guint32 initrwnd; \
\
/* RTA_METRICS.RTAX_RTO_MIN (iproute2: rto_min) */ \
/* Valid only when 'rto_min_set' is true. */ \
/* Valid only when 'rto_min_set' is true. */ \
guint32 rto_min; \
\
/* RTA_METRICS.RTAX_MTU (iproute2: mtu) */ \
@@ -369,7 +369,7 @@ guint _nm_platform_signal_id_get(NMPlatformSignalIdType signal_type);
bool quickack : 1; \
\
/* RTA_METRICS.RTAX_RTO_MIN (iproute2: rto_min) */ \
/* If true, the 'rto_min' value is valid. */ \
/* If true, the 'rto_min' value is valid. */ \
bool rto_min_set : 1; \
\
/* if TRUE, the "metric" field is interpreted as an offset that is added to a default