Skip to content

Commit 887dc9f

Browse files
edumazetdavem330
authored andcommitted
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: 192132b ("net: Add support for VRFs to inetpeer cache") Reported-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9b29c69 commit 887dc9f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎include/net/inetpeer.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void inet_initpeers(void) __init;
7878
static inline void inetpeer_set_addr_v4(struct inetpeer_addr *iaddr, __be32 ip)
7979
{
8080
iaddr->a4.addr = ip;
81+
iaddr->a4.vif = 0;
8182
iaddr->family = AF_INET;
8283
}
8384

0 commit comments

Comments
 (0)