Skip to content

Commit b4d1605

Browse files
dsaherndavem330
authored andcommitted
tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match()
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: a04a480 ("net: Require exact match for TCP socket lookups if dif is l3mdev") Signed-off-by: David Ahern <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent eeea10b commit b4d1605

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/net/tcp.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -844,12 +844,11 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb)
844844
}
845845
#endif
846846

847-
/* TCP_SKB_CB reference means this can not be used from early demux */
848847
static inline bool inet_exact_dif_match(struct net *net, struct sk_buff *skb)
849848
{
850849
#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
851850
if (!net->ipv4.sysctl_tcp_l3mdev_accept &&
852-
skb && ipv4_l3mdev_skb(TCP_SKB_CB(skb)->header.h4.flags))
851+
skb && ipv4_l3mdev_skb(IPCB(skb)->flags))
853852
return true;
854853
#endif
855854
return false;

0 commit comments

Comments
 (0)