Move sk_is_tcp() to include/net/sock.h and use it where we can.
Showing the changes to include (2 of 4 files). Show all
Unified · Split
| @@ -507,12 +507,6 @@ static inline bool sk_psock_strp_enabled(struct sk_psock *psock) · 506 unmodified lines | |||
| 507 | return !!psock->saved_data_ready; | 507 | return !!psock->saved_data_ready; |
| 508 | } | 508 | } |
| 509 | 509 | ||
| 510 | static inline bool sk_is_tcp(const struct sock *sk) | ||
| 511 | { | ||
| 512 | return sk->sk_type == SOCK_STREAM && | ||
| 513 | sk->sk_protocol == IPPROTO_TCP; | ||
| 514 | } | ||
| 515 | |||
| 516 | static inline bool sk_is_udp(const struct sock *sk) | 510 | static inline bool sk_is_udp(const struct sock *sk) |
| 517 | { | 511 | { |
| 518 | return sk->sk_type == SOCK_DGRAM && | 512 | return sk->sk_type == SOCK_DGRAM && |
| @@ -2638,6 +2638,11 @@ static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u16 tsflags) · 2637 unmodified lines | |||
| 2638 | &skb_shinfo(skb)->tskey); | 2638 | &skb_shinfo(skb)->tskey); |
| 2639 | } | 2639 | } |
| 2640 | 2640 | ||
| 2641 | static inline bool sk_is_tcp(const struct sock *sk) | ||
| 2642 | { | ||
| 2643 | return sk->sk_type == SOCK_STREAM && sk->sk_protocol == IPPROTO_TCP; | ||
| 2644 | } | ||
| 2645 | |||
| 2641 | /** | 2646 | /** |
| 2642 | * sk_eat_skb - Release a skb if it is no longer needed | 2647 | * sk_eat_skb - Release a skb if it is no longer needed |
| 2643 | * @sk: socket to eat this skb from | 2648 | * @sk: socket to eat this skb from |