mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
tcp_metrics: fix addr_same() helper
[ Upstream commite6638094d7
] Because v4 and v6 families use separate inetpeer trees (respectively net->ipv4.peers and net->ipv6.peers), inetpeer_addr_cmp(a, b) assumes a & b share the same family. tcp_metrics use a common hash table, where entries can have different families. We must therefore make sure to not call inetpeer_addr_cmp() if the families do not match. Fixes:d39d14ffa2
("net: Add helper function to compare inetpeer addresses") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://lore.kernel.org/r/20230802131500.1478140-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
afac854f82
commit
71f891a254
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ static void tcp_metric_set(struct tcp_metrics_block *tm,
|
|||
static bool addr_same(const struct inetpeer_addr *a,
|
||||
const struct inetpeer_addr *b)
|
||||
{
|
||||
return inetpeer_addr_cmp(a, b) == 0;
|
||||
return (a->family == b->family) && !inetpeer_addr_cmp(a, b);
|
||||
}
|
||||
|
||||
struct tcpm_hash_bucket {
|
||||
|
|
Loading…
Reference in a new issue