Merge branch 'mptcp-misc-minor-cleanups'

Matthieu Baerts says:

====================
mptcp: misc minor cleanups

Here are some small unrelated cleanups collected when working on some
fixes recently.

- Patches 1 & 2: close file descriptors in exit paths in the selftests.

- Patch 3: fix a wrong type (int i/o u32) when parsing netlink message.
====================

Link: https://patch.msgid.link/20250912-net-next-mptcp-minor-fixes-6-18-v1-0-99d179b483ad@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2025-09-15 18:14:25 -07:00
commit ba5c906d51
3 changed files with 15 additions and 5 deletions

View File

@ -113,7 +113,7 @@ int mptcp_pm_parse_entry(struct nlattr *attr, struct genl_info *info,
return err;
if (tb[MPTCP_PM_ADDR_ATTR_IF_IDX]) {
u32 val = nla_get_s32(tb[MPTCP_PM_ADDR_ATTR_IF_IDX]);
s32 val = nla_get_s32(tb[MPTCP_PM_ADDR_ATTR_IF_IDX]);
entry->ifindex = val;
}

View File

@ -502,6 +502,7 @@ static int server(int unixfd)
process_one_client(r, unixfd);
close(fd);
return 0;
}
@ -580,8 +581,12 @@ int main(int argc, char *argv[])
die_perror("pipe");
s = xfork();
if (s == 0)
return server(unixfds[1]);
if (s == 0) {
close(unixfds[0]);
ret = server(unixfds[1]);
close(unixfds[1]);
return ret;
}
close(unixfds[1]);

View File

@ -722,6 +722,7 @@ static int server(int pipefd)
process_one_client(r, pipefd);
close(fd);
return 0;
}
@ -847,8 +848,12 @@ int main(int argc, char *argv[])
die_perror("pipe");
s = xfork();
if (s == 0)
return server(pipefds[1]);
if (s == 0) {
close(pipefds[0]);
ret = server(pipefds[1]);
close(pipefds[1]);
return ret;
}
close(pipefds[1]);