Commit 8e60eed6 authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller
Browse files

mptcp: bugfix for RM_ADDR option parsing



In MPTCPOPT_RM_ADDR option parsing, the pointer "ptr" pointed to the
"Subtype" octet, the pointer "ptr+1" pointed to the "Address ID" octet:

  +-------+-------+---------------+
  |Subtype|(resvd)|   Address ID  |
  +-------+-------+---------------+
  |               |
 ptr            ptr+1

We should set mp_opt->rm_id to the value of "ptr+1", not "ptr". This patch
will fix this bug.

Fixes: 3df523ab ("mptcp: Add ADD_ADDR handling")
Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3763a24c
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -273,6 +273,8 @@ static void mptcp_parse_option(const struct sk_buff *skb,
		if (opsize != TCPOLEN_MPTCP_RM_ADDR_BASE)
		if (opsize != TCPOLEN_MPTCP_RM_ADDR_BASE)
			break;
			break;


		ptr++;

		mp_opt->rm_addr = 1;
		mp_opt->rm_addr = 1;
		mp_opt->rm_id = *ptr++;
		mp_opt->rm_id = *ptr++;
		pr_debug("RM_ADDR: id=%d", mp_opt->rm_id);
		pr_debug("RM_ADDR: id=%d", mp_opt->rm_id);