mptcp: Change options handling so in_addr are in network byte order
Subsystems (2)
Peter Krystad
PATCH 1/2 mptcp: Change options handling so in_addr are in network byte order
squashto: Add ADD_ADDR handling
--- net/mptcp/options.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/mptcp/options.c +3 -2
@@ -209,7 +209,7 @@ void mptcp_parse_option(const unsigned char *ptr, int opsize, mp_opt->addr_id = *ptr++;if (mp_opt->family ==MPTCP_ADDR_IPVERSION_4 ) { mp_opt->add_addr =1 ; - mp_opt->addr.s_addr =get_unaligned_be32 (ptr); +memcpy ((u8 *)&mp_opt->addr.s_addr, (u8 *)ptr,4 );pr_debug ("ADD_ADDR: addr=%x, id=%d" , mp_opt->addr.s_addr, mp_opt->addr_id);#if IS_ENABLED (CONFIG_IPV6 )
@@ -593,7 +593,8 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts)if (OPTION_MPTCP_ADD_ADDR & opts->suboptions) { *ptr++ =mptcp_option (MPTCPOPT_ADD_ADDR ,TCPOLEN_MPTCP_ADD_ADDR ,MPTCP_ADDR_IPVERSION_4 , opts->addr_id); - *ptr++ =htonl (opts->addr.s_addr); +memcpy ((u8 *)ptr, (u8 *)&opts->addr.s_addr,4 ); + ptr +=1 ; }#if IS_ENABLED (CONFIG_IPV6 )
Signature · 1 line
2.17.2
Peter Krystad
PATCH 2/2 mptcp: Modify pm_create_subflow to use in_addr in network byte order
squashto: Implement path manager interface commands
--- net/mptcp/pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/pm.c +1 -1
@@ -73,7 +73,7 @@ int pm_create_subflow(u32 token, u8 remote_id) remote.sin_family = msk->pm.remote_family; remote.sin_port =htons (msk->dport); - remote.sin_addr.s_addr =htonl (msk->pm.remote_addr.s_addr); + remote.sin_addr.s_addr = msk->pm.remote_addr.s_addr; err =subflow_connect ((struct sock *)msk, &local, &remote, remote_id);
Signature · 1 line
2.17.2
Mat Martineau
Re: [MPTCP] [PATCH 2/2] mptcp: Modify pm_create_subflow to use in_addr in network byte order
Quoted 22 lines · Peter Krystad
squashto: Implement path manager interface commands
Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>---
net/mptcp/pm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)net/mptcp/pm.c +1
-1@@ -73,7 +73,7 @@ int pm_create_subflow(u32 token, u8 remote_id) remote.sin_family = msk->pm.remote_family; remote.sin_port =htons (msk->dport); - remote.sin_addr.s_addr =htonl (msk->pm.remote_addr.s_addr); + remote.sin_addr.s_addr = msk->pm.remote_addr.s_addr; err =subflow_connect ((struct sock *)msk, &local, &remote, remote_id);Signature · 1 line
2.17.2
Both patches look good. Thanks.
--
Mat Martineau
Intel
Matthieu Baerts
Re: [MPTCP] [PATCH 2/2] mptcp: Modify pm_create_subflow to use in_addr in network byte order
Hi Peter, Mat,
Quoted 21 lines · Mat Martineau
Quoted 18 lines · Peter Krystad
squashto: Implement path manager interface commands
Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>---
net/mptcp/pm.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)net/mptcp/pm.c +1
-1@@ -73,7 +73,7 @@ int pm_create_subflow(u32 token, u8 remote_id) remote.sin_family = msk->pm.remote_family; remote.sin_port = htons(msk->dport); - remote.sin_addr.s_addr = htonl(msk->pm.remote_addr.s_addr); + remote.sin_addr.s_addr = msk->pm.remote_addr.s_addr;
Quoted 7 lines
Quoted 5 lines
net/mptcp/pm.c +0
-0err = subflow_connect((struct sock *)msk, &local, &remote, remote_id);--
2.17.2Both patches look good. Thanks.
Thank you for the patches and the reviews!
- 773d308c2033: "squashed" the first patch in "mptcp: Add ADD_ADDR handling"
- 722d13a45004: "squashed" the second one in "mptcp: Implement path manager interface commands"
- "signed-off" were already there.
- b94f6125bd9a..695f625aa913: result
Tests are still OK!
Cheers,
Matt
Quoted 8 lines
Signature · 7 lines
-- Mat Martineau Intel _______________________________________________ mptcp mailing list mptcp(a)lists.01.org https://lists.01.org/mailman/listinfo/mptcp
Signature · 5 lines
Matthieu Baerts | R&D Engineer matthieu.baerts(a)tessares.net Tessares SA | Hybrid Access Solutions www.tessares.net 1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium