History

net: use sk_is_tcp() in more places

Move sk_is_tcp() to include/net/sock.h and use it where we can.

Eric Dumazet committed 5 years ago

Commit 42f67ee1 parent 37354404 files · +9 −14Browse files

Showing the changes to include (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/skmsg.h +0 −6
  2. include/net/sock.h +5 −0
include/linux/skmsg.h+0−6
@@ -507,12 +507,6 @@ static inline bool sk_psock_strp_enabled(struct sk_psock *psock) · 506 unmodified lines
507507 return !!psock->saved_data_ready;
508508 }
509509
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−
516510 static inline bool sk_is_udp(const struct sock *sk)
517511 {
518512 return sk->sk_type == SOCK_DGRAM &&
include/net/sock.h+5−0
@@ -2638,6 +2638,11 @@ static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u16 tsflags) · 2637 unmodified lines
26382638 &skb_shinfo(skb)->tskey);
26392639 }
26402640
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+
26412646 /**
26422647 * sk_eat_skb - Release a skb if it is no longer needed
26432648 * @sk: socket to eat this skb from

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t