1
0
Fork 0

tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match()

[ Usptream commit b4d1605a8e ]

After this fix : ("tcp: add tcp_v4_fill_cb()/tcp_v4_restore_cb()"),
socket lookups happen while skb->cb[] has not been mangled yet by TCP.

Fixes: a04a480d43 ("net: Require exact match for TCP socket lookups if dif is l3mdev")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
David Ahern 2017-12-03 09:33:00 -08:00 committed by Greg Kroah-Hartman
parent effea096ca
commit efb7dc5a96
1 changed files with 1 additions and 2 deletions

View File

@ -874,12 +874,11 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb)
}
#endif
/* TCP_SKB_CB reference means this can not be used from early demux */
static inline bool inet_exact_dif_match(struct net *net, struct sk_buff *skb)
{
#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
if (!net->ipv4.sysctl_tcp_l3mdev_accept &&
skb && ipv4_l3mdev_skb(TCP_SKB_CB(skb)->header.h4.flags))
skb && ipv4_l3mdev_skb(IPCB(skb)->flags))
return true;
#endif
return false;