Commit 887dc9f2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

inet: tcp: fix inetpeer_set_addr_v4()

David Ahern added a vif field in the a4 part of inetpeer_addr struct.

This broke IPv4 TCP fast open client side and more generally tcp metrics
cache, because inetpeer_addr_cmp() is now comparing two u32 instead of
one.

inetpeer_set_addr_v4() needs to properly init vif field, otherwise
the comparison result depends on uninitialized data.

Fixes: 192132b9 ("net: Add support for VRFs to inetpeer cache")
Reported-by: default avatarYuchung Cheng <ycheng@google.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9b29c696
...@@ -78,6 +78,7 @@ void inet_initpeers(void) __init; ...@@ -78,6 +78,7 @@ void inet_initpeers(void) __init;
static inline void inetpeer_set_addr_v4(struct inetpeer_addr *iaddr, __be32 ip) static inline void inetpeer_set_addr_v4(struct inetpeer_addr *iaddr, __be32 ip)
{ {
iaddr->a4.addr = ip; iaddr->a4.addr = ip;
iaddr->a4.vif = 0;
iaddr->family = AF_INET; iaddr->family = AF_INET;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment