|
@@ -1111,11 +1111,17 @@ static void tcp_adjust_pcount(struct sock *sk, const struct sk_buff *skb, int de
|
|
|
tcp_verify_left_out(tp);
|
|
|
}
|
|
|
|
|
|
+static bool tcp_has_tx_tstamp(const struct sk_buff *skb)
|
|
|
+{
|
|
|
+ return TCP_SKB_CB(skb)->txstamp_ack ||
|
|
|
+ (skb_shinfo(skb)->tx_flags & SKBTX_ANY_TSTAMP);
|
|
|
+}
|
|
|
+
|
|
|
static void tcp_fragment_tstamp(struct sk_buff *skb, struct sk_buff *skb2)
|
|
|
{
|
|
|
struct skb_shared_info *shinfo = skb_shinfo(skb);
|
|
|
|
|
|
- if (unlikely(shinfo->tx_flags & SKBTX_ANY_TSTAMP) &&
|
|
|
+ if (unlikely(tcp_has_tx_tstamp(skb)) &&
|
|
|
!before(shinfo->tskey, TCP_SKB_CB(skb2)->seq)) {
|
|
|
struct skb_shared_info *shinfo2 = skb_shinfo(skb2);
|
|
|
u8 tsflags = shinfo->tx_flags & SKBTX_ANY_TSTAMP;
|
|
@@ -2446,13 +2452,12 @@ u32 __tcp_select_window(struct sock *sk)
|
|
|
void tcp_skb_collapse_tstamp(struct sk_buff *skb,
|
|
|
const struct sk_buff *next_skb)
|
|
|
{
|
|
|
- const struct skb_shared_info *next_shinfo = skb_shinfo(next_skb);
|
|
|
- u8 tsflags = next_shinfo->tx_flags & SKBTX_ANY_TSTAMP;
|
|
|
-
|
|
|
- if (unlikely(tsflags)) {
|
|
|
+ if (unlikely(tcp_has_tx_tstamp(next_skb))) {
|
|
|
+ const struct skb_shared_info *next_shinfo =
|
|
|
+ skb_shinfo(next_skb);
|
|
|
struct skb_shared_info *shinfo = skb_shinfo(skb);
|
|
|
|
|
|
- shinfo->tx_flags |= tsflags;
|
|
|
+ shinfo->tx_flags |= next_shinfo->tx_flags & SKBTX_ANY_TSTAMP;
|
|
|
shinfo->tskey = next_shinfo->tskey;
|
|
|
TCP_SKB_CB(skb)->txstamp_ack |=
|
|
|
TCP_SKB_CB(next_skb)->txstamp_ack;
|