From: David Ahern Date: Sun, 3 Dec 2017 17:33:00 +0000 (-0800) Subject: tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match() X-Git-Tag: v4.14.7~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=efb7dc5a9658de725de8d0b2016dbe198406d93e;p=platform%2Fkernel%2Flinux-rpi.git tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match() [ Usptream commit b4d1605a8ea608fd7dc45b926a05d75d340bde4b ] 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: a04a480d4392 ("net: Require exact match for TCP socket lookups if dif is l3mdev") Signed-off-by: David Ahern Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/net/tcp.h b/include/net/tcp.h index e6d0002..5dfc92f 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -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;