mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
Merge branch 'mptcp-misc-fixes-for-v6-19-rc1'
Matthieu Baerts says: ==================== mptcp: misc fixes for v6.19-rc1 Here are various unrelated fixes: - Patches 1-2: ignore unknown in-kernel PM endpoint flags instead of pretending they are supported. A fix for v5.7. - Patch 3: avoid potential unnecessary rtx timer expiration. A fix for v5.15. - Patch 4: avoid a deadlock on fallback in case of SKB creation failure while re-injecting. ==================== Link: https://patch.msgid.link/20251205-net-mptcp-misc-fixes-6-19-rc1-v1-0-9e4781a6c1b8@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#define MPTCP_PM_ADDR_FLAG_FULLMESH _BITUL(3)
|
||||
#define MPTCP_PM_ADDR_FLAG_IMPLICIT _BITUL(4)
|
||||
#define MPTCP_PM_ADDR_FLAG_LAMINAR _BITUL(5)
|
||||
#define MPTCP_PM_ADDR_FLAGS_MASK GENMASK(5, 0)
|
||||
|
||||
struct mptcp_info {
|
||||
__u8 mptcpi_subflows;
|
||||
|
||||
@@ -119,7 +119,8 @@ int mptcp_pm_parse_entry(struct nlattr *attr, struct genl_info *info,
|
||||
}
|
||||
|
||||
if (tb[MPTCP_PM_ADDR_ATTR_FLAGS])
|
||||
entry->flags = nla_get_u32(tb[MPTCP_PM_ADDR_ATTR_FLAGS]);
|
||||
entry->flags = nla_get_u32(tb[MPTCP_PM_ADDR_ATTR_FLAGS]) &
|
||||
MPTCP_PM_ADDR_FLAGS_MASK;
|
||||
|
||||
if (tb[MPTCP_PM_ADDR_ATTR_PORT])
|
||||
entry->addr.port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]));
|
||||
|
||||
@@ -1623,7 +1623,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
|
||||
struct mptcp_sendmsg_info info = {
|
||||
.flags = flags,
|
||||
};
|
||||
bool do_check_data_fin = false;
|
||||
bool copied = false;
|
||||
int push_count = 1;
|
||||
|
||||
while (mptcp_send_head(sk) && (push_count > 0)) {
|
||||
@@ -1665,7 +1665,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
|
||||
push_count--;
|
||||
continue;
|
||||
}
|
||||
do_check_data_fin = true;
|
||||
copied = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1674,11 +1674,14 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
|
||||
if (ssk)
|
||||
mptcp_push_release(ssk, &info);
|
||||
|
||||
/* ensure the rtx timer is running */
|
||||
if (!mptcp_rtx_timer_pending(sk))
|
||||
mptcp_reset_rtx_timer(sk);
|
||||
if (do_check_data_fin)
|
||||
/* Avoid scheduling the rtx timer if no data has been pushed; the timer
|
||||
* will be updated on positive acks by __mptcp_cleanup_una().
|
||||
*/
|
||||
if (copied) {
|
||||
if (!mptcp_rtx_timer_pending(sk))
|
||||
mptcp_reset_rtx_timer(sk);
|
||||
mptcp_check_send_data_fin(sk);
|
||||
}
|
||||
}
|
||||
|
||||
static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool first)
|
||||
@@ -2766,10 +2769,13 @@ static void __mptcp_retrans(struct sock *sk)
|
||||
|
||||
/*
|
||||
* make the whole retrans decision, xmit, disallow
|
||||
* fallback atomic
|
||||
* fallback atomic, note that we can't retrans even
|
||||
* when an infinite fallback is in progress, i.e. new
|
||||
* subflows are disallowed.
|
||||
*/
|
||||
spin_lock_bh(&msk->fallback_lock);
|
||||
if (__mptcp_check_fallback(msk)) {
|
||||
if (__mptcp_check_fallback(msk) ||
|
||||
!msk->allow_subflows) {
|
||||
spin_unlock_bh(&msk->fallback_lock);
|
||||
release_sock(ssk);
|
||||
goto clear_scheduled;
|
||||
|
||||
@@ -192,6 +192,10 @@ check "show_endpoints" \
|
||||
flush_endpoint
|
||||
check "show_endpoints" "" "flush addrs"
|
||||
|
||||
add_endpoint 10.0.1.1 flags unknown
|
||||
check "show_endpoints" "$(format_endpoints "1,10.0.1.1")" "ignore unknown flags"
|
||||
flush_endpoint
|
||||
|
||||
set_limits 9 1 2>/dev/null
|
||||
check "get_limits" "${default_limits}" "rcv addrs above hard limit"
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#define IPPROTO_MPTCP 262
|
||||
#endif
|
||||
|
||||
#define MPTCP_PM_ADDR_FLAG_UNKNOWN _BITUL(7)
|
||||
|
||||
static void syntax(char *argv[])
|
||||
{
|
||||
fprintf(stderr, "%s add|ann|rem|csf|dsf|get|set|del|flush|dump|events|listen|accept [<args>]\n", argv[0]);
|
||||
@@ -836,6 +838,8 @@ int add_addr(int fd, int pm_family, int argc, char *argv[])
|
||||
flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
|
||||
else if (!strcmp(tok, "fullmesh"))
|
||||
flags |= MPTCP_PM_ADDR_FLAG_FULLMESH;
|
||||
else if (!strcmp(tok, "unknown"))
|
||||
flags |= MPTCP_PM_ADDR_FLAG_UNKNOWN;
|
||||
else
|
||||
error(1, errno,
|
||||
"unknown flag %s", argv[arg]);
|
||||
@@ -1048,6 +1052,13 @@ static void print_addr(struct rtattr *attrs, int len)
|
||||
printf(",");
|
||||
}
|
||||
|
||||
if (flags & MPTCP_PM_ADDR_FLAG_UNKNOWN) {
|
||||
printf("unknown");
|
||||
flags &= ~MPTCP_PM_ADDR_FLAG_UNKNOWN;
|
||||
if (flags)
|
||||
printf(",");
|
||||
}
|
||||
|
||||
/* bump unknown flags, if any */
|
||||
if (flags)
|
||||
printf("0x%x", flags);
|
||||
|
||||
Reference in New Issue
Block a user