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
507 return !!psock->saved_data_ready;507 return !!psock->saved_data_ready;
508}508}
509 509
510static 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
516static inline bool sk_is_udp(const struct sock *sk)510static 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 &&
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
2638 &skb_shinfo(skb)->tskey);2638 &skb_shinfo(skb)->tskey);
2639}2639}
2640 2640
2641static 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 needed2647 * sk_eat_skb - Release a skb if it is no longer needed
2643 * @sk: socket to eat this skb from2648 * @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