All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH net-next 11/16] mptcp: enable use_port when invoke addresses_equal
Date: Thu, 28 Jan 2021 17:11:10 -0800	[thread overview]
Message-ID: <20210129011115.133953-12-mathew.j.martineau@linux.intel.com> (raw)
In-Reply-To: 20210129011115.133953-1-mathew.j.martineau@linux.intel.com

[-- Attachment #1: Type: text/plain, Size: 1898 bytes --]

From: Geliang Tang <geliangtang(a)gmail.com>

When dealing with the addresses list local_addr_list or anno_list, we
should enable the function addresses_equal's parameter use_port. And
enable it in address_zero too.

Signed-off-by: Geliang Tang <geliangtang(a)gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau(a)linux.intel.com>
---
 net/mptcp/pm_netlink.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index d6e23e079fb0..5b045023fe15 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -91,7 +91,7 @@ static bool address_zero(const struct mptcp_addr_info *addr)
 	memset(&zero, 0, sizeof(zero));
 	zero.family = addr->family;
 
-	return addresses_equal(addr, &zero, false);
+	return addresses_equal(addr, &zero, true);
 }
 
 static void local_address(const struct sock_common *skc,
@@ -131,7 +131,7 @@ static bool lookup_subflow_by_saddr(const struct list_head *list,
 		skc = (struct sock_common *)mptcp_subflow_tcp_sock(subflow);
 
 		local_address(skc, &cur);
-		if (addresses_equal(&cur, saddr, false))
+		if (addresses_equal(&cur, saddr, saddr->port))
 			return true;
 	}
 
@@ -247,7 +247,7 @@ lookup_anno_list_by_saddr(struct mptcp_sock *msk,
 	struct mptcp_pm_add_entry *entry;
 
 	list_for_each_entry(entry, &msk->pm.anno_list, list) {
-		if (addresses_equal(&entry->addr, addr, false))
+		if (addresses_equal(&entry->addr, addr, true))
 			return entry;
 	}
 
@@ -773,7 +773,7 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) {
-		if (addresses_equal(&entry->addr, &skc_local, false)) {
+		if (addresses_equal(&entry->addr, &skc_local, entry->addr.port)) {
 			ret = entry->addr.id;
 			break;
 		}
-- 
2.30.0

WARNING: multiple messages have this Message-ID (diff)
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: netdev@vger.kernel.org
Cc: Geliang Tang <geliangtang@gmail.com>,
	davem@davemloft.net, kuba@kernel.org, mptcp@lists.01.org,
	Mat Martineau <mathew.j.martineau@linux.intel.com>
Subject: [PATCH net-next 11/16] mptcp: enable use_port when invoke addresses_equal
Date: Thu, 28 Jan 2021 17:11:10 -0800	[thread overview]
Message-ID: <20210129011115.133953-12-mathew.j.martineau@linux.intel.com> (raw)
In-Reply-To: <20210129011115.133953-1-mathew.j.martineau@linux.intel.com>

From: Geliang Tang <geliangtang@gmail.com>

When dealing with the addresses list local_addr_list or anno_list, we
should enable the function addresses_equal's parameter use_port. And
enable it in address_zero too.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
 net/mptcp/pm_netlink.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index d6e23e079fb0..5b045023fe15 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -91,7 +91,7 @@ static bool address_zero(const struct mptcp_addr_info *addr)
 	memset(&zero, 0, sizeof(zero));
 	zero.family = addr->family;
 
-	return addresses_equal(addr, &zero, false);
+	return addresses_equal(addr, &zero, true);
 }
 
 static void local_address(const struct sock_common *skc,
@@ -131,7 +131,7 @@ static bool lookup_subflow_by_saddr(const struct list_head *list,
 		skc = (struct sock_common *)mptcp_subflow_tcp_sock(subflow);
 
 		local_address(skc, &cur);
-		if (addresses_equal(&cur, saddr, false))
+		if (addresses_equal(&cur, saddr, saddr->port))
 			return true;
 	}
 
@@ -247,7 +247,7 @@ lookup_anno_list_by_saddr(struct mptcp_sock *msk,
 	struct mptcp_pm_add_entry *entry;
 
 	list_for_each_entry(entry, &msk->pm.anno_list, list) {
-		if (addresses_equal(&entry->addr, addr, false))
+		if (addresses_equal(&entry->addr, addr, true))
 			return entry;
 	}
 
@@ -773,7 +773,7 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(entry, &pernet->local_addr_list, list) {
-		if (addresses_equal(&entry->addr, &skc_local, false)) {
+		if (addresses_equal(&entry->addr, &skc_local, entry->addr.port)) {
 			ret = entry->addr.id;
 			break;
 		}
-- 
2.30.0


             reply	other threads:[~2021-01-29  1:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29  1:11 Mat Martineau [this message]
2021-01-29  1:11 ` [PATCH net-next 11/16] mptcp: enable use_port when invoke addresses_equal Mat Martineau
  -- strict thread matches above, loose matches on Subject: below --
2021-01-30  5:55 [MPTCP] Re: [PATCH net-next 01/16] mptcp: use WRITE_ONCE/READ_ONCE for the pernet *_max Jakub Kicinski
2021-01-30  5:55 ` Jakub Kicinski
2021-01-30  5:54 [MPTCP] " Jakub Kicinski
2021-01-30  5:54 ` Jakub Kicinski
2021-01-29  1:11 [MPTCP] [PATCH net-next 16/16] selftests: mptcp: add command line arguments for mptcp_join.sh Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 15/16] selftests: mptcp: add testcases for ADD_ADDR with port Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 14/16] mptcp: add the mibs " Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 13/16] selftests: mptcp: add port argument for pm_nl_ctl Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 12/16] mptcp: deal with MPTCP_PM_ADDR_ATTR_PORT in PM netlink Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 10/16] mptcp: add port number check for MP_JOIN Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 09/16] mptcp: add a new helper subflow_req_create_thmac Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 08/16] mptcp: drop unused skb in subflow_token_join_request Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 07/16] mptcp: create the listening socket for new port Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 06/16] selftests: mptcp: add testcases for newly added addresses Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 05/16] selftests: mptcp: use minus values for removing address numbers Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 04/16] mptcp: send ack for every add_addr Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 03/16] mptcp: create subflow or signal addr for newly added address Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 02/16] mptcp: drop *_max fields in mptcp_pm_data Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:11 [MPTCP] [PATCH net-next 01/16] mptcp: use WRITE_ONCE/READ_ONCE for the pernet *_max Mat Martineau
2021-01-29  1:11 ` Mat Martineau
2021-01-29  1:10 [MPTCP] [PATCH net-next 00/16] mptcp: ADD_ADDR enhancements Mat Martineau
2021-01-29  1:10 ` Mat Martineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210129011115.133953-12-mathew.j.martineau@linux.intel.com \
    --to=unknown@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.