aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_output.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 8fcfc91964ec..ef4a051de018 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1069,6 +1069,21 @@ static void tcp_adjust_pcount(struct sock *sk, const struct sk_buff *skb, int de
1069 tcp_verify_left_out(tp); 1069 tcp_verify_left_out(tp);
1070} 1070}
1071 1071
1072static void tcp_fragment_tstamp(struct sk_buff *skb, struct sk_buff *skb2)
1073{
1074 struct skb_shared_info *shinfo = skb_shinfo(skb);
1075
1076 if (unlikely(shinfo->tx_flags & SKBTX_ANY_TSTAMP) &&
1077 !before(shinfo->tskey, TCP_SKB_CB(skb2)->seq)) {
1078 struct skb_shared_info *shinfo2 = skb_shinfo(skb2);
1079 u8 tsflags = shinfo->tx_flags & SKBTX_ANY_TSTAMP;
1080
1081 shinfo->tx_flags &= ~tsflags;
1082 shinfo2->tx_flags |= tsflags;
1083 swap(shinfo->tskey, shinfo2->tskey);
1084 }
1085}
1086
1072/* Function to create two new TCP segments. Shrinks the given segment 1087/* Function to create two new TCP segments. Shrinks the given segment
1073 * to the specified size and appends a new segment with the rest of the 1088 * to the specified size and appends a new segment with the rest of the
1074 * packet to the list. This won't be called frequently, I hope. 1089 * packet to the list. This won't be called frequently, I hope.
@@ -1136,6 +1151,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len,
1136 */ 1151 */
1137 TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; 1152 TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when;
1138 buff->tstamp = skb->tstamp; 1153 buff->tstamp = skb->tstamp;
1154 tcp_fragment_tstamp(skb, buff);
1139 1155
1140 old_factor = tcp_skb_pcount(skb); 1156 old_factor = tcp_skb_pcount(skb);
1141 1157
@@ -1652,6 +1668,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
1652 1668
1653 buff->ip_summed = skb->ip_summed = CHECKSUM_PARTIAL; 1669 buff->ip_summed = skb->ip_summed = CHECKSUM_PARTIAL;
1654 skb_split(skb, buff, len); 1670 skb_split(skb, buff, len);
1671 tcp_fragment_tstamp(skb, buff);
1655 1672
1656 /* Fix up tso_factor for both original and new SKB. */ 1673 /* Fix up tso_factor for both original and new SKB. */
1657 tcp_set_skb_tso_segs(sk, skb, mss_now); 1674 tcp_set_skb_tso_segs(sk, skb, mss_now);