network: also take Route::initcwnd and ::initrwnd into hash func

Fixes #13506.
This commit is contained in:
Yu Watanabe 2019-09-10 00:18:05 +09:00
parent c077a205e7
commit fa3e401a79
2 changed files with 35 additions and 0 deletions

View File

@ -435,6 +435,31 @@ int manager_rtnl_process_route(sd_netlink *rtnl, sd_netlink_message *message, vo
return 0;
}
r = sd_netlink_message_enter_container(message, RTA_METRICS);
if (r < 0 && r != -ENODATA) {
log_link_error_errno(link, r, "rtnl: Could not enter RTA_METRICS container: %m");
return 0;
}
if (r >= 0) {
r = sd_netlink_message_read_u32(message, RTAX_INITCWND, &tmp->initcwnd);
if (r < 0 && r != -ENODATA) {
log_link_warning_errno(link, r, "rtnl: received route message with invalid initcwnd, ignoring: %m");
return 0;
}
r = sd_netlink_message_read_u32(message, RTAX_INITRWND, &tmp->initrwnd);
if (r < 0 && r != -ENODATA) {
log_link_warning_errno(link, r, "rtnl: received route message with invalid initrwnd, ignoring: %m");
return 0;
}
r = sd_netlink_message_exit_container(message);
if (r < 0) {
log_link_error_errno(link, r, "rtnl: Could not exit from RTA_METRICS container: %m");
return 0;
}
}
(void) route_get(link, tmp, &route);
if (DEBUG_LOGGING) {

View File

@ -170,6 +170,8 @@ static void route_hash_func(const Route *route, struct siphash *state) {
siphash24_compress(&route->protocol, sizeof(route->protocol), state);
siphash24_compress(&route->scope, sizeof(route->scope), state);
siphash24_compress(&route->type, sizeof(route->type), state);
siphash24_compress(&route->initcwnd, sizeof(route->initcwnd), state);
siphash24_compress(&route->initrwnd, sizeof(route->initrwnd), state);
break;
default:
@ -220,6 +222,14 @@ static int route_compare_func(const Route *a, const Route *b) {
if (r != 0)
return r;
r = CMP(a->initcwnd, b->initcwnd);
if (r != 0)
return r;
r = CMP(a->initrwnd, b->initrwnd);
if (r != 0)
return r;
r = memcmp(&a->gw, &b->gw, FAMILY_ADDRESS_SIZE(a->family));
if (r != 0)
return r;