Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352430
b: refs/heads/master
c: 93be6ce
h: refs/heads/master
v: v3
  • Loading branch information
Andrey Vagin authored and David S. Miller committed Feb 13, 2013
1 parent 90d33ef commit 46ad3e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ceaa1fef65a7c2e017b260b879b310dd24888083
refs/heads/master: 93be6ce0e91b6a94783e012b1857a347a5e6e9f2
1 change: 1 addition & 0 deletions trunk/include/uapi/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ enum {
#define TCP_QUEUE_SEQ 21
#define TCP_REPAIR_OPTIONS 22
#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
#define TCP_TIMESTAMP 24

struct tcp_repair_opt {
__u32 opt_code;
Expand Down
9 changes: 9 additions & 0 deletions trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2714,6 +2714,12 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
else
err = -EINVAL;
break;
case TCP_TIMESTAMP:
if (!tp->repair)
err = -EPERM;
else
tp->tsoffset = val - tcp_time_stamp;
break;
default:
err = -ENOPROTOOPT;
break;
Expand Down Expand Up @@ -2962,6 +2968,9 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
case TCP_USER_TIMEOUT:
val = jiffies_to_msecs(icsk->icsk_user_timeout);
break;
case TCP_TIMESTAMP:
val = tcp_time_stamp + tp->tsoffset;
break;
default:
return -ENOPROTOOPT;
}
Expand Down

0 comments on commit 46ad3e5

Please sign in to comment.