Skip to content
Permalink
Browse files
Squash to "mptcp: infinite mapping receiving"
Please update the commit log too:

'''
This patch added the infinite mapping receiving logic.

In mptcp_incoming_options(), invoke the new helper function
mptcp_infinite_map_received() to check whether the infinite mapping
is received. If it is, set the infinite_map flag of struct mptcp_ext.

In get_mapping_status(), if the infinite mapping is received, set the
map_data_len of the subflow to 0.

In subflow_check_data_avail(), only reset the subflow when the map_data_len
of the subflow is non-zero.
'''

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
  • Loading branch information
geliangtang authored and intel-lab-lkp committed Oct 21, 2021
1 parent 2f111a6 commit ca85326898507008f999c544140bfcecb30316b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
@@ -1081,6 +1081,14 @@ static bool add_addr_hmac_valid(struct mptcp_sock *msk,
return hmac == mp_opt->ahmac;
}

static bool mptcp_infinite_map_received(struct mptcp_options_received *mp_opt)
{
if (mp_opt->use_map && !mp_opt->data_len)
return true;

return false;
}

/* Return false if a subflow has been reset, else return true */
bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
{
@@ -1089,7 +1097,9 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
struct mptcp_options_received mp_opt;
struct mptcp_ext *mpext;

if (__mptcp_check_fallback(msk)) {
mptcp_get_options(sk, skb, &mp_opt);

if (__mptcp_check_fallback(msk) && !mptcp_infinite_map_received(&mp_opt)) {
/* Keep it simple and unconditionally trigger send data cleanup and
* pending queue spooling. We will need to acquire the data lock
* for more accurate checks, and once the lock is acquired, such
@@ -1103,8 +1113,6 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
return true;
}

mptcp_get_options(sk, skb, &mp_opt);

/* The subflow can be in close state only if check_fully_established()
* just sent a reset. If so, tell the caller to ignore the current packet.
*/
@@ -1206,6 +1214,8 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)

if (mpext->csum_reqd)
mpext->csum = mp_opt.csum;
if (mptcp_infinite_map_received(&mp_opt))
mpext->infinite_map = 1;
}

return true;
@@ -938,7 +938,7 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
if (!skb)
return MAPPING_EMPTY;

if (mptcp_check_fallback(ssk))
if (mptcp_check_fallback(ssk) && !mptcp_check_infinite_map(skb))
return MAPPING_DUMMY;

mpext = mptcp_get_ext(skb);

0 comments on commit ca85326

Please sign in to comment.