Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[sfrench/cifs-2.6.git] / net / ipv4 / ip_output.c
index 8d3b6b0e98574b5507f05972cf7fbac8ba32c465..215af2b155cb1946ff5f4b4d7d0fff19291573b8 100644 (file)
@@ -855,11 +855,15 @@ static int __ip_append_data(struct sock *sk,
        unsigned int maxfraglen, fragheaderlen, maxnonfragsize;
        int csummode = CHECKSUM_NONE;
        struct rtable *rt = (struct rtable *)cork->dst;
+       u32 tskey = 0;
 
        skb = skb_peek_tail(queue);
 
        exthdrlen = !skb ? rt->dst.header_len : 0;
        mtu = cork->fragsize;
+       if (cork->tx_flags & SKBTX_ANY_SW_TSTAMP &&
+           sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID)
+               tskey = sk->sk_tskey++;
 
        hh_len = LL_RESERVED_SPACE(rt->dst.dev);
 
@@ -962,10 +966,6 @@ alloc_new_skb:
                                                           sk->sk_allocation);
                                if (unlikely(skb == NULL))
                                        err = -ENOBUFS;
-                               else
-                                       /* only the initial fragment is
-                                          time stamped */
-                                       cork->tx_flags = 0;
                        }
                        if (skb == NULL)
                                goto error;
@@ -976,7 +976,12 @@ alloc_new_skb:
                        skb->ip_summed = csummode;
                        skb->csum = 0;
                        skb_reserve(skb, hh_len);
+
+                       /* only the initial fragment is time stamped */
                        skb_shinfo(skb)->tx_flags = cork->tx_flags;
+                       cork->tx_flags = 0;
+                       skb_shinfo(skb)->tskey = tskey;
+                       tskey = 0;
 
                        /*
                         *      Find where to start putting bytes.