Skip to content

Commit

Permalink
Revert "mptcp: Make sure ADD_ADDR2 option is sent with no other options"
Browse files Browse the repository at this point in the history
This reverts commit 522c149.
  • Loading branch information
fabriziodemaria committed Nov 25, 2015
1 parent 720e7fd commit d80199c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
11 changes: 1 addition & 10 deletions net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,16 +698,7 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb
#else
*md5 = NULL;
#endif
if (mptcp(tp)) {
struct mptcp_cb *mpcb = tp->mpcb;
/* It is recommended to use duplicate ACKs with no other
* payload or options when transmitting ADD_ADDR2.
*/
if (unlikely(mpcb->addr_signal)) {
mptcp_established_options(sk, skb, opts, &size);
return size;
}
}

if (likely(tp->rx_opt.tstamp_ok)) {
opts->options |= OPTION_TS;
opts->tsval = skb ? tcp_skb_timestamp(skb) + tp->tsoffset : 0;
Expand Down
14 changes: 12 additions & 2 deletions net/mptcp/mptcp_fullmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,12 @@ static void full_mesh_addr_signal(struct sock *sk, unsigned *size,

/* IPv4 */
unannouncedv4 = (~fmp->announced_addrs_v4) & mptcp_local->loc4_bits;
if (unannouncedv4) {
if (unannouncedv4 &&
((mpcb->mptcp_ver == 0 &&
MAX_TCP_OPTION_SPACE - *size >= MPTCP_SUB_LEN_ADD_ADDR4_ALIGN) ||
(mpcb->mptcp_ver >= 1 &&
MAX_TCP_OPTION_SPACE - *size >=
MPTCP_SUB_LEN_ADD_ADDR4_ALIGN_VER1))) {
int ind = mptcp_find_free_index(~unannouncedv4);

opts->options |= OPTION_MPTCP;
Expand Down Expand Up @@ -1588,7 +1593,12 @@ static void full_mesh_addr_signal(struct sock *sk, unsigned *size,
skip_ipv4:
/* IPv6 */
unannouncedv6 = (~fmp->announced_addrs_v6) & mptcp_local->loc6_bits;
if (unannouncedv6) {
if (unannouncedv6 &&
((mpcb->mptcp_ver == 0 &&
MAX_TCP_OPTION_SPACE - *size >= MPTCP_SUB_LEN_ADD_ADDR6_ALIGN) ||
(mpcb->mptcp_ver >= 1 &&
MAX_TCP_OPTION_SPACE - *size >=
MPTCP_SUB_LEN_ADD_ADDR6_ALIGN_VER1))) {
int ind = mptcp_find_free_index(~unannouncedv6);

opts->options |= OPTION_MPTCP;
Expand Down

0 comments on commit d80199c

Please sign in to comment.