aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVijay Subramanian <subramanian.vijay@gmail.com>2011-12-20 13:23:24 +0000
committerDavid S. Miller <davem@davemloft.net>2011-12-21 01:03:23 -0500
commitab56222a32b9dbaae19c1d37f07b0ac4fc3c27ec (patch)
treece5eff7879a1d80c419835171de13e52c24afdfb /include
parent08f4fc9da9a04d59f5c937e06e375158abb68206 (diff)
tcp: Replace constants with #define macros
to record the state of SACK/FACK and DSACK for better readability and maintenance. Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/tcp.h5
-rw-r--r--include/net/tcp.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7f59ee94698..46a85c9e1f2 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -238,6 +238,11 @@ struct tcp_sack_block {
u32 end_seq;
};
+/*These are used to set the sack_ok field in struct tcp_options_received */
+#define TCP_SACK_SEEN (1 << 0) /*1 = peer is SACK capable, */
+#define TCP_FACK_ENABLED (1 << 1) /*1 = FACK is enabled locally*/
+#define TCP_DSACK_SEEN (1 << 2) /*1 = DSACK was received from peer*/
+
struct tcp_options_received {
/* PAWS/RTTM data */
long ts_recent_stamp;/* Time we stored ts_recent (for aging) */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index a4f52e15484..0118ea999f6 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -773,12 +773,12 @@ static inline int tcp_is_reno(const struct tcp_sock *tp)
static inline int tcp_is_fack(const struct tcp_sock *tp)
{
- return tp->rx_opt.sack_ok & 2;
+ return tp->rx_opt.sack_ok & TCP_FACK_ENABLED;
}
static inline void tcp_enable_fack(struct tcp_sock *tp)
{
- tp->rx_opt.sack_ok |= 2;
+ tp->rx_opt.sack_ok |= TCP_FACK_ENABLED;
}
static inline unsigned int tcp_left_out(const struct tcp_sock *tp)