MPTCP Linux Development
 help / color / mirror / Atom feed
From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: netdev@vger.kernel.org
Cc: Kishen Maloor <kishen.maloor@intel.com>,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	matthieu.baerts@tessares.net, mptcp@lists.linux.dev,
	Mat Martineau <mathew.j.martineau@linux.intel.com>
Subject: [PATCH net-next 7/7] mptcp: allow ADD_ADDR reissuance by userspace PMs
Date: Mon,  2 May 2022 13:52:37 -0700	[thread overview]
Message-ID: <20220502205237.129297-8-mathew.j.martineau@linux.intel.com> (raw)
In-Reply-To: <20220502205237.129297-1-mathew.j.martineau@linux.intel.com>

From: Kishen Maloor <kishen.maloor@intel.com>

This change allows userspace PM implementations to reissue ADD_ADDR
announcements (if necessary) based on their chosen policy.

Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Kishen Maloor <kishen.maloor@intel.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
 net/mptcp/pm_netlink.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index a4430c576ce9..98b205c2c101 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -369,8 +369,16 @@ static bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
 
 	lockdep_assert_held(&msk->pm.lock);
 
-	if (mptcp_lookup_anno_list_by_saddr(msk, &entry->addr))
-		return false;
+	add_entry = mptcp_lookup_anno_list_by_saddr(msk, &entry->addr);
+
+	if (add_entry) {
+		if (mptcp_pm_is_kernel(msk))
+			return false;
+
+		sk_reset_timer(sk, &add_entry->add_timer,
+			       jiffies + mptcp_get_add_addr_timeout(net));
+		return true;
+	}
 
 	add_entry = kmalloc(sizeof(*add_entry), GFP_ATOMIC);
 	if (!add_entry)
-- 
2.36.0


  parent reply	other threads:[~2022-05-02 20:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 20:52 [PATCH net-next 0/7] mptcp: Userspace path manager prerequisites Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 1/7] mptcp: bypass in-kernel PM restrictions for non-kernel PMs Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 2/7] selftests: mptcp: ADD_ADDR echo test with missing userspace daemon Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 3/7] mptcp: store remote id from MP_JOIN SYN/ACK in local ctx Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 4/7] mptcp: reflect remote port (not 0) in ANNOUNCED events Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 5/7] mptcp: establish subflows from either end of connection Mat Martineau
2022-05-02 20:52 ` [PATCH net-next 6/7] mptcp: expose server_side attribute in MPTCP netlink events Mat Martineau
2022-05-02 20:52 ` Mat Martineau [this message]
2022-05-04  0:00 ` [PATCH net-next 0/7] mptcp: Userspace path manager prerequisites patchwork-bot+netdevbpf

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=20220502205237.129297-8-mathew.j.martineau@linux.intel.com \
    --to=mathew.j.martineau@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=kishen.maloor@intel.com \
    --cc=kuba@kernel.org \
    --cc=matthieu.baerts@tessares.net \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox