mptcp: use mptcp_addr_info in mptcp_options_received
authorGeliang Tang <geliangtang@gmail.com>
Wed, 7 Apr 2021 00:16:00 +0000 (17:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Apr 2021 21:09:39 +0000 (14:09 -0700)
commitf7dafee18538a3933f2cb9d4dcf8b98ff1276ffb
treec43fb68aacd471a4a7dd89201bd50845149314db
parentfef6b7ecfbd465b7e27530e797c00b7384f78e44
mptcp: use mptcp_addr_info in mptcp_options_received

This patch added a new struct mptcp_addr_info member addr in struct
mptcp_options_received, and dropped the original family, addr_id, addr,
addr6 and port fields in it. Then we can pass the parameter mp_opt.addr
directly to mptcp_pm_add_addr_received and mptcp_pm_add_addr_echoed.

Since the port number became big-endian now, use htons to convert the
incoming port number to it. Also use ntohs to convert it when passing
it to add_addr_generate_hmac or printing it out.

Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/options.c
net/mptcp/protocol.h