diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2012-04-18 23:40:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-21 15:52:25 -0400 |
commit | ee9952831cfd0bbe834f4a26489d7dce74582e37 (patch) | |
tree | 64c195fa45e1a200f38d68751161d8e06dfb5a6c /include | |
parent | 370816aef0c5436c2adbec3966038f36ca326933 (diff) |
tcp: Initial repair mode
This includes (according the the previous description):
* TCP_REPAIR sockoption
This one just puts the socket in/out of the repair mode.
Allowed for CAP_NET_ADMIN and for closed/establised sockets only.
When repair mode is turned off and the socket happens to be in
the established state the window probe is sent to the peer to
'unlock' the connection.
* TCP_REPAIR_QUEUE sockoption
This one sets the queue which we're about to repair. The
'no-queue' is set by default.
* TCP_QUEUE_SEQ socoption
Sets the write_seq/rcv_nxt of a selected repaired queue.
Allowed for TCP_CLOSE-d sockets only. When the socket changes
its state the other seq-s are changed by the kernel according
to the protocol rules (most of the existing code is actually
reused).
* Ability to forcibly bind a socket to a port
The sk->sk_reuse is set to SK_FORCE_REUSE.
* Immediate connect modification
The connect syscall initializes the connection, then directly jumps
to the code which finalizes it.
* Silent close modification
The close just aborts the connection (similar to SO_LINGER with 0
time) but without sending any FIN/RST-s to peer.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tcp.h | 14 | ||||
-rw-r--r-- | include/net/tcp.h | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index b6c62d294380..4e90e6ae79df 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -106,6 +106,16 @@ enum { | |||
106 | #define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ | 106 | #define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ |
107 | #define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ | 107 | #define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ |
108 | #define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */ | 108 | #define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */ |
109 | #define TCP_REPAIR 19 /* TCP sock is under repair right now */ | ||
110 | #define TCP_REPAIR_QUEUE 20 | ||
111 | #define TCP_QUEUE_SEQ 21 | ||
112 | |||
113 | enum { | ||
114 | TCP_NO_QUEUE, | ||
115 | TCP_RECV_QUEUE, | ||
116 | TCP_SEND_QUEUE, | ||
117 | TCP_QUEUES_NR, | ||
118 | }; | ||
109 | 119 | ||
110 | /* for TCP_INFO socket option */ | 120 | /* for TCP_INFO socket option */ |
111 | #define TCPI_OPT_TIMESTAMPS 1 | 121 | #define TCPI_OPT_TIMESTAMPS 1 |
@@ -353,7 +363,9 @@ struct tcp_sock { | |||
353 | u8 nonagle : 4,/* Disable Nagle algorithm? */ | 363 | u8 nonagle : 4,/* Disable Nagle algorithm? */ |
354 | thin_lto : 1,/* Use linear timeouts for thin streams */ | 364 | thin_lto : 1,/* Use linear timeouts for thin streams */ |
355 | thin_dupack : 1,/* Fast retransmit on first dupack */ | 365 | thin_dupack : 1,/* Fast retransmit on first dupack */ |
356 | unused : 2; | 366 | repair : 1, |
367 | unused : 1; | ||
368 | u8 repair_queue; | ||
357 | 369 | ||
358 | /* RTT measurement */ | 370 | /* RTT measurement */ |
359 | u32 srtt; /* smoothed round trip time << 3 */ | 371 | u32 srtt; /* smoothed round trip time << 3 */ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 633fde27f24b..b4ccb8a6c9c1 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -612,6 +612,8 @@ static inline u32 tcp_receive_window(const struct tcp_sock *tp) | |||
612 | */ | 612 | */ |
613 | extern u32 __tcp_select_window(struct sock *sk); | 613 | extern u32 __tcp_select_window(struct sock *sk); |
614 | 614 | ||
615 | void tcp_send_window_probe(struct sock *sk); | ||
616 | |||
615 | /* TCP timestamps are only 32-bits, this causes a slight | 617 | /* TCP timestamps are only 32-bits, this causes a slight |
616 | * complication on 64-bit systems since we store a snapshot | 618 | * complication on 64-bit systems since we store a snapshot |
617 | * of jiffies in the buffer control blocks below. We decided | 619 | * of jiffies in the buffer control blocks below. We decided |