aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/raw.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2014-07-14 17:55:06 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-15 19:32:45 -0400
commit11878b40ed5c5bc20d6a115bae156a5b90b0fb3e (patch)
treee7fa05e4bc8d22865c7877e05bff85c3ecee1dc8 /net/ipv4/raw.c
parentd5c1c93681699a2c354a8999b3c77e419bdadb64 (diff)
net-timestamp: SOCK_RAW and PING timestamping
Add SO_TIMESTAMPING to sockets of type PF_INET[6]/SOCK_RAW: Add the necessary sock_tx_timestamp calls to the datapath for RAW sockets (ping sockets already had these calls). Fix the IP output path to pass the timestamp flags on the first fragment also for these sockets. The existing code relies on transhdrlen != 0 to indicate a first fragment. For these sockets, that assumption does not hold. This fixes http://bugzilla.kernel.org/show_bug.cgi?id=77221 Tested SOCK_RAW on IPv4 and IPv6, not PING. Signed-off-by: Willem de Bruijn <willemb@google.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r--net/ipv4/raw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 2c65160565e1..2054d7136c62 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -365,6 +365,8 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
365 365
366 skb->ip_summed = CHECKSUM_NONE; 366 skb->ip_summed = CHECKSUM_NONE;
367 367
368 sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
369
368 skb->transport_header = skb->network_header; 370 skb->transport_header = skb->network_header;
369 err = -EFAULT; 371 err = -EFAULT;
370 if (memcpy_fromiovecend((void *)iph, from, 0, length)) 372 if (memcpy_fromiovecend((void *)iph, from, 0, length))
@@ -606,6 +608,8 @@ back_from_confirm:
606 &rt, msg->msg_flags); 608 &rt, msg->msg_flags);
607 609
608 else { 610 else {
611 sock_tx_timestamp(sk, &ipc.tx_flags);
612
609 if (!ipc.addr) 613 if (!ipc.addr)
610 ipc.addr = fl4.daddr; 614 ipc.addr = fl4.daddr;
611 lock_sock(sk); 615 lock_sock(sk);