From: Eric Dumazet Date: Wed, 16 Dec 2015 04:56:44 +0000 (-0800) Subject: inet: tcp: fix inetpeer_set_addr_v4() X-Git-Tag: v4.4~75^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=887dc9f2cef6e98dcccf807da5e6faf4f60ba483;p=platform%2Fkernel%2Flinux-amlogic.git 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: 192132b9a034 ("net: Add support for VRFs to inetpeer cache") Reported-by: Yuchung Cheng Signed-off-by: Eric Dumazet Cc: Neal Cardwell Signed-off-by: David S. Miller --- diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 4a6009d..235c781 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h @@ -78,6 +78,7 @@ void inet_initpeers(void) __init; static inline void inetpeer_set_addr_v4(struct inetpeer_addr *iaddr, __be32 ip) { iaddr->a4.addr = ip; + iaddr->a4.vif = 0; iaddr->family = AF_INET; }