Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279038
b: refs/heads/master
c: ab56222
h: refs/heads/master
v: v3
  • Loading branch information
Vijay Subramanian authored and David S. Miller committed Dec 21, 2011
1 parent 6697331 commit 2acdc7f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08f4fc9da9a04d59f5c937e06e375158abb68206
refs/heads/master: ab56222a32b9dbaae19c1d37f07b0ac4fc3c27ec
5 changes: 5 additions & 0 deletions trunk/include/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/syncookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ bool cookie_check_timestamp(struct tcp_options_received *tcp_opt, bool *ecn_ok)
if (!sysctl_tcp_timestamps)
return false;

tcp_opt->sack_ok = (options >> 4) & 0x1;
tcp_opt->sack_ok = (options & (1 << 4)) ? TCP_SACK_SEEN : 0;
*ecn_ok = (options >> 5) & 1;
if (*ecn_ok && !sysctl_tcp_ecn)
return false;
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,13 +865,13 @@ static void tcp_disable_fack(struct tcp_sock *tp)
/* RFC3517 uses different metric in lost marker => reset on change */
if (tcp_is_fack(tp))
tp->lost_skb_hint = NULL;
tp->rx_opt.sack_ok &= ~2;
tp->rx_opt.sack_ok &= ~TCP_FACK_ENABLED;
}

/* Take a notice that peer is sending D-SACKs */
static void tcp_dsack_seen(struct tcp_sock *tp)
{
tp->rx_opt.sack_ok |= 4;
tp->rx_opt.sack_ok |= TCP_DSACK_SEEN;
}

/* Initialize metrics on socket. */
Expand Down Expand Up @@ -3878,7 +3878,7 @@ void tcp_parse_options(const struct sk_buff *skb, struct tcp_options_received *o
case TCPOPT_SACK_PERM:
if (opsize == TCPOLEN_SACK_PERM && th->syn &&
!estab && sysctl_tcp_sack) {
opt_rx->sack_ok = 1;
opt_rx->sack_ok = TCP_SACK_SEEN;
tcp_sack_reset(opt_rx);
}
break;
Expand Down

0 comments on commit 2acdc7f

Please sign in to comment.