From patchwork Thu Apr 7 23:40:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishen Maloor X-Patchwork-Id: 12805908 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADAC23D75 for ; Thu, 7 Apr 2022 23:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649374837; x=1680910837; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=sKHGYS4wSoiHYtJWAVjOUe7mFJkoa0zCDSkyK1QyfBM=; b=ZPiumsIi/s+U+LAoXkjFEnaDtELydxkTX4jy7wbJpMVrPvBOXO8kbg0u BpIPc3RIg7N2BEVLiZ0OgLsCr7nJEbtFub++WTOF+LZIYex11cPHyztpv TrUPS85xOzinbM2xbgITKuj3UBqUmXZNhW87PRYqFYwDek3WRjPHZL+cQ +3BRkZ7KTj8Iqj5fByCf8mxvR21yihFbbudp+Pp0LhUVgFfzNBlEvUkpS HZSSk4591kZR6Np/cIv6VMxFk4dcJxZAB8oibBk5FZn24hpi7+1DyRNXY qr/NLbsxWjthrfk1xSA5xLlkYC9TJmJ1QCiwMgmJhqdyF9uzTO5yZrskK A==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="259062008" X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="259062008" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 16:40:36 -0700 X-IronPort-AV: E=Sophos;i="5.90,242,1643702400"; d="scan'208";a="571270938" Received: from otc-tsn-4.jf.intel.com ([10.23.153.135]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 16:40:35 -0700 From: Kishen Maloor To: kishen.maloor@intel.com, mptcp@lists.linux.dev Subject: [PATCH mptcp-next v8 01/14] mptcp: allow ADD_ADDR reissuance by userspace PMs Date: Thu, 7 Apr 2022 19:40:16 -0400 Message-Id: <20220407234029.1774481-2-kishen.maloor@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220407234029.1774481-1-kishen.maloor@intel.com> References: <20220407234029.1774481-1-kishen.maloor@intel.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This change allows userspace PM implementations to reissue ADD_ADDR announcements (if necessary) based on their chosen policy. Signed-off-by: Kishen Maloor --- 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)