diff options
| author | Willem de Bruijn <willemb@google.com> | 2015-01-30 13:29:31 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-02-02 21:46:51 -0500 |
| commit | 49ca0d8bfaf3bc46d5eef60ce67b00eb195bd392 (patch) | |
| tree | d2f55a32923f6d91fcb2e0d0e0b6d2d4eb6f9abd /net/ipv6 | |
| parent | 9766e97af1b901ffbb36fcc648e50626d926bb24 (diff) | |
net-timestamp: no-payload option
Add timestamping option SOF_TIMESTAMPING_OPT_TSONLY. For transmit
timestamps, this loops timestamps on top of empty packets.
Doing so reduces the pressure on SO_RCVBUF. Payload inspection and
cmsg reception (aside from timestamps) are no longer possible. This
works together with a follow on patch that allows administrators to
only allow tx timestamping if it does not loop payload or metadata.
Signed-off-by: Willem de Bruijn <willemb@google.com>
----
Changes (rfc -> v1)
- add documentation
- remove unnecessary skb->len test (thanks to Richard Cochran)
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
| -rw-r--r-- | net/ipv6/datagram.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 49f5e73db122..c215be70cac0 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
| @@ -369,7 +369,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) | |||
| 369 | 369 | ||
| 370 | serr = SKB_EXT_ERR(skb); | 370 | serr = SKB_EXT_ERR(skb); |
| 371 | 371 | ||
| 372 | if (sin) { | 372 | if (sin && skb->len) { |
| 373 | const unsigned char *nh = skb_network_header(skb); | 373 | const unsigned char *nh = skb_network_header(skb); |
| 374 | sin->sin6_family = AF_INET6; | 374 | sin->sin6_family = AF_INET6; |
| 375 | sin->sin6_flowinfo = 0; | 375 | sin->sin6_flowinfo = 0; |
| @@ -394,8 +394,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) | |||
| 394 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); | 394 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); |
| 395 | sin = &errhdr.offender; | 395 | sin = &errhdr.offender; |
| 396 | memset(sin, 0, sizeof(*sin)); | 396 | memset(sin, 0, sizeof(*sin)); |
| 397 | 397 | if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL && skb->len) { | |
| 398 | if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) { | ||
| 399 | sin->sin6_family = AF_INET6; | 398 | sin->sin6_family = AF_INET6; |
| 400 | if (np->rxopt.all) { | 399 | if (np->rxopt.all) { |
| 401 | if (serr->ee.ee_origin != SO_EE_ORIGIN_ICMP && | 400 | if (serr->ee.ee_origin != SO_EE_ORIGIN_ICMP && |
