diff options
| author | Eric Dumazet <[email protected]> | 2021-11-15 19:02:33 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2021-11-16 13:10:34 +0000 |
| commit | 42f67eea3ba36cef2dce2e853de6ddcb2e89eb39 (patch) | |
| tree | 384aa7cd5164824de1c9178629fe82f2bd9fe516 /net/core/skbuff.c | |
| parent | tcp: small optimization in tcp_v6_send_check() (diff) | |
| download | kernel-42f67eea3ba36cef2dce2e853de6ddcb2e89eb39.tar.gz kernel-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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/core/skbuff.c')
| -rw-r--r-- | net/core/skbuff.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ba2f38246f07..d57796f38a0b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4849,8 +4849,7 @@ static void __skb_complete_tx_timestamp(struct sk_buff *skb, serr->header.h4.iif = skb->dev ? skb->dev->ifindex : 0; if (sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID) { serr->ee.ee_data = skb_shinfo(skb)->tskey; - if (sk->sk_protocol == IPPROTO_TCP && - sk->sk_type == SOCK_STREAM) + if (sk_is_tcp(sk)) serr->ee.ee_data -= sk->sk_tskey; } @@ -4919,8 +4918,7 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb, if (tsonly) { #ifdef CONFIG_INET if ((sk->sk_tsflags & SOF_TIMESTAMPING_OPT_STATS) && - sk->sk_protocol == IPPROTO_TCP && - sk->sk_type == SOCK_STREAM) { + sk_is_tcp(sk)) { skb = tcp_get_timestamping_opt_stats(sk, orig_skb, ack_skb); opt_stats = true; |
