Merge branch 'mptcp-cleanups'
Matthieu Baerts says: ==================== mptcp: various small cleanups Patch 1 makes a function static because it is only used in one file. Patch 2 adds info about the git trees we use to help occasional devs. Patch 3 removes an unused variable. Patch 4 removes duplicated entries from the help menu of a tool used in MPTCP selftests. Patch 5 removes some ShellCheck warnings in mptcp_join.sh selftest. Only very minor improvements then. ==================== Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
9bf55bd442
@ -14617,6 +14617,8 @@ L: mptcp@lists.linux.dev
|
||||
S: Maintained
|
||||
W: https://github.com/multipath-tcp/mptcp_net-next/wiki
|
||||
B: https://github.com/multipath-tcp/mptcp_net-next/issues
|
||||
T: git https://github.com/multipath-tcp/mptcp_net-next.git export-net
|
||||
T: git https://github.com/multipath-tcp/mptcp_net-next.git export
|
||||
F: Documentation/networking/mptcp-sysctl.rst
|
||||
F: include/net/mptcp.h
|
||||
F: include/trace/events/mptcp.h
|
||||
|
@ -442,7 +442,6 @@ static void clear_3rdack_retransmission(struct sock *sk)
|
||||
static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb,
|
||||
bool snd_data_fin_enable,
|
||||
unsigned int *size,
|
||||
unsigned int remaining,
|
||||
struct mptcp_out_options *opts)
|
||||
{
|
||||
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
|
||||
@ -556,7 +555,6 @@ static void mptcp_write_data_fin(struct mptcp_subflow_context *subflow,
|
||||
static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
|
||||
bool snd_data_fin_enable,
|
||||
unsigned int *size,
|
||||
unsigned int remaining,
|
||||
struct mptcp_out_options *opts)
|
||||
{
|
||||
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
|
||||
@ -580,7 +578,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
|
||||
opts->ext_copy = *mpext;
|
||||
}
|
||||
|
||||
remaining -= map_size;
|
||||
dss_size = map_size;
|
||||
if (skb && snd_data_fin_enable)
|
||||
mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
|
||||
@ -851,9 +848,9 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
|
||||
}
|
||||
|
||||
snd_data_fin = mptcp_data_fin_enabled(msk);
|
||||
if (mptcp_established_options_mp(sk, skb, snd_data_fin, &opt_size, remaining, opts))
|
||||
if (mptcp_established_options_mp(sk, skb, snd_data_fin, &opt_size, opts))
|
||||
ret = true;
|
||||
else if (mptcp_established_options_dss(sk, skb, snd_data_fin, &opt_size, remaining, opts)) {
|
||||
else if (mptcp_established_options_dss(sk, skb, snd_data_fin, &opt_size, opts)) {
|
||||
unsigned int mp_fail_size;
|
||||
|
||||
ret = true;
|
||||
|
@ -25,8 +25,8 @@ void mptcp_free_local_addr_list(struct mptcp_sock *msk)
|
||||
}
|
||||
}
|
||||
|
||||
int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
|
||||
struct mptcp_pm_addr_entry *entry)
|
||||
static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
|
||||
struct mptcp_pm_addr_entry *entry)
|
||||
{
|
||||
DECLARE_BITMAP(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1);
|
||||
struct mptcp_pm_addr_entry *match = NULL;
|
||||
|
@ -830,8 +830,6 @@ int mptcp_pm_remove_subflow(struct mptcp_sock *msk, const struct mptcp_rm_list *
|
||||
void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk,
|
||||
struct list_head *rm_list);
|
||||
|
||||
int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk,
|
||||
struct mptcp_pm_addr_entry *entry);
|
||||
void mptcp_free_local_addr_list(struct mptcp_sock *msk);
|
||||
int mptcp_nl_cmd_announce(struct sk_buff *skb, struct genl_info *info);
|
||||
int mptcp_nl_cmd_remove(struct sk_buff *skb, struct genl_info *info);
|
||||
|
@ -106,8 +106,8 @@ static struct cfg_sockopt_types cfg_sockopt_types;
|
||||
static void die_usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage: mptcp_connect [-6] [-c cmsg] [-f offset] [-i file] [-I num] [-j] [-l] "
|
||||
"[-m mode] [-M mark] [-o option] [-p port] [-P mode] [-j] [-l] [-r num] "
|
||||
"[-s MPTCP|TCP] [-S num] [-r num] [-t num] [-T num] [-u] [-w sec] connect_address\n");
|
||||
"[-m mode] [-M mark] [-o option] [-p port] [-P mode] [-r num] [-R num] "
|
||||
"[-s MPTCP|TCP] [-S num] [-t num] [-T num] [-w sec] connect_address\n");
|
||||
fprintf(stderr, "\t-6 use ipv6\n");
|
||||
fprintf(stderr, "\t-c cmsg -- test cmsg type <cmsg>\n");
|
||||
fprintf(stderr, "\t-f offset -- stop the I/O after receiving and sending the specified amount "
|
||||
@ -126,13 +126,13 @@ static void die_usage(void)
|
||||
fprintf(stderr, "\t-p num -- use port num\n");
|
||||
fprintf(stderr,
|
||||
"\t-P [saveWithPeek|saveAfterPeek] -- save data with/after MSG_PEEK form tcp socket\n");
|
||||
fprintf(stderr, "\t-t num -- set poll timeout to num\n");
|
||||
fprintf(stderr, "\t-T num -- set expected runtime to num ms\n");
|
||||
fprintf(stderr, "\t-r num -- enable slow mode, limiting each write to num bytes "
|
||||
"-- for remove addr tests\n");
|
||||
fprintf(stderr, "\t-R num -- set SO_RCVBUF to num\n");
|
||||
fprintf(stderr, "\t-s [MPTCP|TCP] -- use mptcp(default) or tcp sockets\n");
|
||||
fprintf(stderr, "\t-S num -- set SO_SNDBUF to num\n");
|
||||
fprintf(stderr, "\t-t num -- set poll timeout to num\n");
|
||||
fprintf(stderr, "\t-T num -- set expected runtime to num ms\n");
|
||||
fprintf(stderr, "\t-w num -- wait num sec before closing the socket\n");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -6,6 +6,10 @@
|
||||
# address all other issues detected by shellcheck.
|
||||
#shellcheck disable=SC2086
|
||||
|
||||
# ShellCheck incorrectly believes that most of the code here is unreachable
|
||||
# because it's invoked by variable name, see how the "tests" array is used
|
||||
#shellcheck disable=SC2317
|
||||
|
||||
ret=0
|
||||
sin=""
|
||||
sinfail=""
|
||||
@ -371,8 +375,9 @@ check_transfer()
|
||||
|
||||
local line
|
||||
if [ -n "$bytes" ]; then
|
||||
local out_size
|
||||
# when truncating we must check the size explicitly
|
||||
local out_size=$(wc -c $out | awk '{print $1}')
|
||||
out_size=$(wc -c $out | awk '{print $1}')
|
||||
if [ $out_size -ne $bytes ]; then
|
||||
echo "[ FAIL ] $what output file has wrong size ($out_size, $bytes)"
|
||||
fail_test
|
||||
@ -500,6 +505,7 @@ kill_events_pids()
|
||||
|
||||
kill_tests_wait()
|
||||
{
|
||||
#shellcheck disable=SC2046
|
||||
kill -SIGUSR1 $(ip netns pids $ns2) $(ip netns pids $ns1)
|
||||
wait
|
||||
}
|
||||
@ -1703,7 +1709,7 @@ chk_subflow_nr()
|
||||
|
||||
cnt1=$(ss -N $ns1 -tOni | grep -c token)
|
||||
cnt2=$(ss -N $ns2 -tOni | grep -c token)
|
||||
if [ "$cnt1" != "$subflow_nr" -o "$cnt2" != "$subflow_nr" ]; then
|
||||
if [ "$cnt1" != "$subflow_nr" ] || [ "$cnt2" != "$subflow_nr" ]; then
|
||||
echo "[fail] got $cnt1:$cnt2 subflows expected $subflow_nr"
|
||||
fail_test
|
||||
dump_stats=1
|
||||
|
Loading…
x
Reference in New Issue
Block a user