Skip to content

Commit

Permalink
tcp: use IPCB instead of TCP_SKB_CB in inet_exact_dif_match()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dsahern authored and davem330 committed Dec 3, 2017
1 parent eeea10b commit b4d1605
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b4d1605

Please sign in to comment.