From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH net 2/2] tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match() Date: Fri, 1 Dec 2017 15:08:13 -0800 Message-ID: <20171201230813.18776-3-edumazet@google.com> References: <20171201230813.18776-1-edumazet@google.com> Cc: netdev , Eric Dumazet , Eric Dumazet , David Ahern , James Morris , Casey Schaufler , David Ahern To: "David S . Miller" Return-path: Received: from mail-pl0-f67.google.com ([209.85.160.67]:33479 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031AbdLAXIZ (ORCPT ); Fri, 1 Dec 2017 18:08:25 -0500 Received: by mail-pl0-f67.google.com with SMTP id q7so7109920plk.0 for ; Fri, 01 Dec 2017 15:08:25 -0800 (PST) In-Reply-To: <20171201230813.18776-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: From: David Ahern 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 --- include/net/tcp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 4e09398009c10a72478b43d3cffc24ba01612b91..6998707e81f343ef8d893c0b2ba16db541082230 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -844,12 +844,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; -- 2.15.0.531.g2ccb3012c9-goog