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;
                        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;
 
                        /*
                         *      Find where to start putting bytes.
 
 
        skb->ip_summed = CHECKSUM_NONE;
 
+       sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
+
        skb->transport_header = skb->network_header;
        err = -EFAULT;
        if (memcpy_fromiovecend((void *)iph, from, 0, length))
                                      &rt, msg->msg_flags);
 
         else {
+               sock_tx_timestamp(sk, &ipc.tx_flags);
+
                if (!ipc.addr)
                        ipc.addr = fl4.daddr;
                lock_sock(sk);
 
        }
 
        /* For UDP, check if TX timestamp is enabled */
-       if (sk->sk_type == SOCK_DGRAM)
+       if (sk->sk_type == SOCK_DGRAM || sk->sk_type == SOCK_RAW)
                sock_tx_timestamp(sk, &tx_flags);
 
        /*
                                                           sk->sk_allocation);
                                if (unlikely(skb == NULL))
                                        err = -ENOBUFS;
-                               else {
-                                       /* Only the initial fragment
-                                        * is time stamped.
-                                        */
-                                       tx_flags = 0;
-                               }
                        }
                        if (skb == NULL)
                                goto error;
                        skb_reserve(skb, hh_len + sizeof(struct frag_hdr) +
                                    dst_exthdrlen);
 
-                       if (sk->sk_type == SOCK_DGRAM)
-                               skb_shinfo(skb)->tx_flags = tx_flags;
+                       /* Only the initial fragment is time stamped */
+                       skb_shinfo(skb)->tx_flags = tx_flags;
+                       tx_flags = 0;
 
                        /*
                         *      Find where to start putting bytes