diff options
author | Eric Dumazet <edumazet@google.com> | 2021-11-15 20:02:33 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-11-16 14:10:34 +0100 |
commit | 42f67eea3ba36cef2dce2e853de6ddcb2e89eb39 (patch) | |
tree | 384aa7cd5164824de1c9178629fe82f2bd9fe516 /include/net/sock.h | |
parent | tcp: small optimization in tcp_v6_send_check() (diff) | |
download | linux-42f67eea3ba36cef2dce2e853de6ddcb2e89eb39.tar.xz linux-42f67eea3ba36cef2dce2e853de6ddcb2e89eb39.zip |
net: use sk_is_tcp() in more places
Move sk_is_tcp() to include/net/sock.h and use it where we can.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index b32906e1ab55..5bdeffdea5ec 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2638,6 +2638,11 @@ static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u16 tsflags) &skb_shinfo(skb)->tskey); } +static inline bool sk_is_tcp(const struct sock *sk) +{ + return sk->sk_type == SOCK_STREAM && sk->sk_protocol == IPPROTO_TCP; +} + /** * sk_eat_skb - Release a skb if it is no longer needed * @sk: socket to eat this skb from |