userspace pm remove id 0 subflow & address
Subsystems (3)
v5 cover userspace pm remove id 0 subflow & address
v5:
- update userspace_pm_add_addr/sf helpers.
- add userspace_pm_rm_addr/sf helpers.
- remove id 0 subflow or address will send MP_RST, add chk_rst_nr for them.
- add two selftests cleanups using for-loop.
v4:
- add evts_get_info and chk_subflows helpers.
- split the selftests patch into three.
v3:
- address Matt's comments in v2.
v2:
- fix CI errors.
This patchset addresses #379 and #391, add the abilities to remove id 0 subflow and address for userspace PM. And a selftest.
Geliang Tang (9):
selftests: mptcp: update userspace pm add helpers
selftests: mptcp: update userspace pm rm helpers
selftests: mptcp: userspace pm remove id 0 subflow
mptcp: userspace pm allow creating id 0 subflow
selftests: mptcp: userspace pm create id 0 subflow
mptcp: userspace pm remove id 0 address
selftests: mptcp: userspace pm remove id 0 address
selftests: mptcp: simplify checksum_tests
selftests: mptcp: simplify deny_join_id0_tests
net/mptcp/pm_userspace.c | 40 ++- .../testing/selftests/net/mptcp/mptcp_join.sh | 329 +++++++++++------- 2 files changed, 230 insertions(+), 139 deletions(-)
Signature · 1 line
2.35.3
PATCH v5 1/9 selftests: mptcp: update userspace pm add helpers
This patch adds a new helper evts_get_info(), using 'sed' command to parse the value of the given keyword in the output of 'pm_nl_ctl events' command, to make the userpsace pm selftests more readable.
Then add a new argument namespace to userspace_pm_add_addr() and userspace_pm_add_sf() to make these two helper more versatile.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +23 -13
@@ -3255,15 +3255,23 @@ fail_tests() fi } +# $1: info name ; $2: ns ; $3: event type +evts_get_info() +{ + sed -n '/^type:'${3:-1}',/p' "${2}" | + sed -n 's/.*\('${1}':\)\([0-9a-f:.]*\).*$/\2/p;q' +} + +# $1: ns ; $2: addr ; $3: id userspace_pm_add_addr() { - local addr=$1 - local id=$2 + local evts=$evts_ns1 local tk - tk=$(grep "type:1," "$evts_ns1" | - sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q') - ip netns exec $ns1 ./pm_nl_ctl ann $addr token $tk id $id + [ "$1" == "$ns2" ] && evts=$evts_ns2 + tk=$(evts_get_info token "$evts") + + ip netns exec $1 ./pm_nl_ctl ann $2 token $tk id $3 sleep 1 }
@@ -3288,16 +3296,18 @@ userspace_pm_rm_sf_addr_ns1() wait_rm_sf $ns1 1 } +# $1: ns ; $2: addr ; $3: id userspace_pm_add_sf() { - local addr=$1 - local id=$2 + local evts=$evts_ns1 local tk da dp - tk=$(sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - da=$(sed -n 's/.*\(daddr4:\)\([0-9.]*\).*$/\2/p;q' "$evts_ns2") - dp=$(sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - ip netns exec $ns2 ./pm_nl_ctl csf lip $addr lid $id \ + [ "$1" == "$ns2" ] && evts=$evts_ns2 + tk=$(evts_get_info token "$evts") + da=$(evts_get_info daddr4 "$evts") + dp=$(evts_get_info dport "$evts") + + ip netns exec $1 ./pm_nl_ctl csf lip $2 lid $3 \ rip $da rport $dp token $tk sleep 1 }
@@ -3404,7 +3414,7 @@ userspace_tests() run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=$! wait_mpj $ns1 - userspace_pm_add_addr 10.0.2.1 10 + userspace_pm_add_addr $ns1 10.0.2.1 10 chk_join_nr 1 1 1 chk_add_nr 1 1 chk_mptcp_info subflows 1 subflows 1
@@ -3425,7 +3435,7 @@ userspace_tests() run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=$! wait_mpj $ns2 - userspace_pm_add_sf 10.0.3.2 20 + userspace_pm_add_sf $ns2 10.0.3.2 20 chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 userspace_pm_rm_sf_addr_ns2 10.0.3.2 20
Signature · 1 line
2.35.3
PATCH v5 2/9 selftests: mptcp: update userspace pm rm helpers
In reply to Geliang TangAdd two more versatile helpers for userspace pm remove subflow or address:userspace_pm_rm_addr() and userspace_pm_rm_sf(). The original test helpers userspace_pm_rm_sf_addr_ns1() and userspace_pm_rm_sf_addr_ns2() can be replaced by these new helpers.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 59 +++++++++---------- 1 file changed, 27 insertions(+), 32 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +27 -32
@@ -3275,25 +3275,17 @@ userspace_pm_add_addr() sleep 1 } -userspace_pm_rm_sf_addr_ns1() +# $1: ns ; $2: id +userspace_pm_rm_addr() { - local addr=$1 - local id=$2 - local tk sp da dp - - tk=$(grep "type:1," "$evts_ns1" | - sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q') - sp=$(grep "type:10" "$evts_ns1" | - sed -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q') - da=$(grep "type:10" "$evts_ns1" | - sed -n 's/.*\(daddr6:\)\([0-9a-f:.]*\).*$/\2/p;q') - dp=$(grep "type:10" "$evts_ns1" | - sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q') - ip netns exec $ns1 ./pm_nl_ctl rem token $tk id $id - ip netns exec $ns1 ./pm_nl_ctl dsf lip "::ffff:$addr" \ - lport $sp rip $da rport $dp token $tk - wait_rm_addr $ns1 1 - wait_rm_sf $ns1 1 + local evts=$evts_ns1 + local tk + + [ "$1" == "$ns2" ] && evts=$evts_ns2 + tk=$(evts_get_info token "$evts") + + ip netns exec $1 ./pm_nl_ctl rem token $tk id $2 + wait_rm_addr $1 1 } # $1: ns ; $2: addr ; $3: id
@@ -3312,22 +3304,23 @@ userspace_pm_add_sf() sleep 1 } -userspace_pm_rm_sf_addr_ns2() +# $1: ns ; $2: event type ; $3: addr +userspace_pm_rm_sf() { - local addr=$1 - local id=$2 + local evts=$evts_ns1 + local ip=4 local tk da dp sp - tk=$(sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - da=$(sed -n 's/.*\(daddr4:\)\([0-9.]*\).*$/\2/p;q' "$evts_ns2") - dp=$(sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - sp=$(grep "type:10" "$evts_ns2" | - sed -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q') - ip netns exec $ns2 ./pm_nl_ctl rem token $tk id $id - ip netns exec $ns2 ./pm_nl_ctl dsf lip $addr lport $sp \ + [ "$1" == "$ns2" ] && evts=$evts_ns2 + if is_v6 $3; then ip=6; fi + tk=$(evts_get_info token "$evts") + da=$(evts_get_info "daddr$ip" "$evts" "$2") + dp=$(evts_get_info dport "$evts" "$2") + sp=$(evts_get_info sport "$evts" "$2") + + ip netns exec $1 ./pm_nl_ctl dsf lip $3 lport $sp \ rip $da rport $dp token $tk - wait_rm_addr $ns2 1 - wait_rm_sf $ns2 1 + wait_rm_sf $1 1 } userspace_tests()
@@ -3419,7 +3412,8 @@ userspace_tests() chk_add_nr 1 1 chk_mptcp_info subflows 1 subflows 1 chk_mptcp_info add_addr_signal 1 add_addr_accepted 1 - userspace_pm_rm_sf_addr_ns1 10.0.2.1 10 + userspace_pm_rm_addr $ns1 10 + userspace_pm_rm_sf $ns1 10 "::ffff:10.0.2.1" chk_rm_nr 1 1 invert chk_mptcp_info subflows 0 subflows 0 kill_events_pids
@@ -3438,7 +3432,8 @@ userspace_tests() userspace_pm_add_sf $ns2 10.0.3.2 20 chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 - userspace_pm_rm_sf_addr_ns2 10.0.3.2 20 + userspace_pm_rm_addr $ns2 20 + userspace_pm_rm_sf $ns2 10 10.0.3.2 chk_rm_nr 1 1 chk_mptcp_info subflows 0 subflows 0 kill_events_pids
Signature · 1 line
2.35.3
PATCH v5 3/9 selftests: mptcp: userspace pm remove id 0 subflow
In reply to Geliang TangThis patch adds a selftest for userpsace PM to remove id 0 subflow. Use userspace_pm_add_sf() to add a subflow, and pass initial ip address to userspace_pm_rm_sf() to remove id 0 subflow.
Add a new helper chk_all_subflows(), in it use 'ss' command
ss -ti | grep -c tcp-ulp-mptcp
to get the "correct" amount of subflows, including the initial subflow.
When closing the initial subflow in __mptcp_close_ssk(), dispose_it is false, then tcp_disconnect is invoked. This will send a MP_RST to close a subflow on the peer too. So chk_rst_nr() is added in this test, and chk_all_subflows after closing the initial subflow is '1 1', not '2 1'.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +47 -0
@@ -1883,6 +1883,31 @@ chk_mptcp_info() fi } +# $1: subflows in ns1 ; $2: subflows in ns2 +# number of all subflows, including the initial subflow. +chk_all_subflows() +{ + local cnt1 + local cnt2 + + print_check "all subflows $1:$2" + + cnt1=$(ss -N $ns1 -ti | grep -c tcp-ulp-mptcp) + cnt2=$(ss -N $ns2 -ti | grep -c tcp-ulp-mptcp) + + if [ "$1" != "$cnt1" ] || [ "$2" != "$cnt2" ]; then + fail_test "got subflows $cnt1:$cnt2 expected $1:$2" + dump_stats=1 + else + print_ok + fi + + if [ "$dump_stats" = 1 ]; then + ss -N $ns1 -ti + ss -N $ns2 -ti + fi +} + chk_link_usage() { local ns=$1
@@ -3439,6 +3464,28 @@ userspace_tests() kill_events_pids wait $tests_pid fi + + # userspace pm remove id 0 subflow + if reset_with_events "userspace pm remove id 0 subflow" && + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + set_userspace_pm $ns2 + pm_nl_set_limits $ns1 0 1 + speed=10 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + wait_mpj $ns2 + userspace_pm_add_sf $ns2 10.0.3.2 20 + chk_join_nr 1 1 1 + chk_mptcp_info subflows 1 subflows 1 + chk_all_subflows 2 2 + userspace_pm_rm_sf $ns2 1 10.0.1.2 + chk_rm_nr 0 1 + chk_rst_nr 1 1 invert + chk_mptcp_info subflows 1 subflows 1 + chk_all_subflows 1 1 + kill_events_pids + wait $tests_pid + fi } endpoint_tests()
Signature · 1 line
2.35.3
PATCH v5 4/9 mptcp: userspace pm allow creating id 0 subflow
In reply to Geliang TangThis patch drops id 0 limitation in mptcp_nl_cmd_sf_create() to allow creating additional subflows with the local addr ID 0.
There is no reason not to allow additional subflows from this local
address: we should be able to create new subflows from the initial endpoint. This limitation was breaking fullmesh support from userspace.
--- net/mptcp/pm_userspace.c | 6 ------ 1 file changed, 6 deletions(-)
net/mptcp/pm_userspace.c +0 -6
@@ -307,12 +307,6 @@ int mptcp_nl_cmd_sf_create(struct sk_buff *skb, struct genl_info *info) goto create_err; } -if (addr_l.id ==0 ) { -NL_SET_ERR_MSG_ATTR (info->extack, laddr,"missing local addr id" ); - err = -EINVAL ; - goto create_err; - } - err =mptcp_pm_parse_addr (raddr, info, &addr_r);if (err <0 ) {NL_SET_ERR_MSG_ATTR (info->extack, raddr,"error parsing remote addr" );
Signature · 1 line
2.35.3
PATCH v5 5/9 selftests: mptcp: userspace pm create id 0 subflow
In reply to Geliang TangThis patch adds a selftest to create id 0 subflow. Pass id 0 to the helper userspace_pm_add_sf() to create id 0 subflow. chk_mptcp_info shows one subflow but chk_all_subflows shows two subflows in each namespace.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +19 -0
@@ -3465,6 +3465,25 @@ userspace_tests() wait $tests_pid fi + # userspace pm create id 0 subflow + if reset_with_events "userspace pm create id 0 subflow" && + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + set_userspace_pm $ns2 + pm_nl_set_limits $ns1 0 1 + speed=slow \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + wait_mpj $ns2 + chk_mptcp_info subflows 0 subflows 0 + chk_all_subflows 1 1 + userspace_pm_add_sf $ns2 10.0.3.2 0 + chk_join_nr 1 1 1 + chk_mptcp_info subflows 1 subflows 1 + chk_all_subflows 2 2 + kill_events_pids + wait $tests_pid + fi + # userspace pm remove id 0 subflow if reset_with_events "userspace pm remove id 0 subflow" && continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then
Signature · 1 line
2.35.3
PATCH v5 6/9 mptcp: userspace pm remove id 0 address
In reply to Geliang TangThis patch adds the ability to send RM_ADDR for local ID 0. Check whether id 0 address is removed, if not, put id 0 into a removing list, pass it to mptcp_pm_remove_addr() to remove id 0 address.
There is no reason not to allow the userspace to remove the initial address (ID 0). This special case was not taken into account not letting the userspace to delete all addresses as announced.
--- net/mptcp/pm_userspace.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
net/mptcp/pm_userspace.c +34 -0
@@ -208,6 +208,37 @@ int mptcp_nl_cmd_announce(struct sk_buff *skb, struct genl_info *info)return err; } +static int mptcp_userspace_remove_id_zero_address (struct mptcp_sock *msk, +struct genl_info *info) +{ +struct mptcp_rm_list list = { .nr =0 }; +struct mptcp_subflow_context *subflow; +bool has_id_0 = false; +int err = -EINVAL ; + +lock_sock ((struct sock *)msk); +spin_lock_bh (&msk->pm.lock); +mptcp_for_each_subflow (msk, subflow) { +if (subflow->remote_id ==0 ) { + has_id_0 = true; +break ; + } + } +if (!has_id_0) { +GENL_SET_ERR_MSG (info,"address with id 0 not found" ); + goto out; + } + + list.ids[list.nr++] =0 ; +mptcp_pm_remove_addr (msk, &list); + err =0 ; +out: +spin_unlock_bh (&msk->pm.lock); +release_sock ((struct sock *)msk); +sock_put ((struct sock *)msk); +return err; +} +int mptcp_nl_cmd_remove (struct sk_buff *skb,struct genl_info *info) {struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN ];
@@ -239,6 +270,9 @@ int mptcp_nl_cmd_remove(struct sk_buff *skb, struct genl_info *info) goto remove_err; } +if (id_val ==0 ) +return mptcp_userspace_remove_id_zero_address (msk, info); +lock_sock ((struct sock *)msk);list_for_each_entry (entry, &msk->pm.userspace_pm_local_addr_list, list) {
Signature · 1 line
2.35.3
PATCH v5 7/9 selftests: mptcp: userspace pm remove id 0 address
In reply to Geliang TangThis patch adds a selftest for userpsace PM to remove id 0 address. Use userspace_pm_add_addr() helper to add a id 10 address, then use userspace_pm_rm_addr() helper to remove id 0 address.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +24 -0
@@ -3505,6 +3505,30 @@ userspace_tests() kill_events_pids wait $tests_pid fi + + # userspace pm remove id 0 address + if reset_with_events "userspace pm remove id 0 address" && + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + set_userspace_pm $ns1 + pm_nl_set_limits $ns2 1 1 + speed=10 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + wait_mpj $ns1 + userspace_pm_add_addr $ns1 10.0.2.1 10 + chk_join_nr 1 1 1 + chk_add_nr 1 1 + chk_mptcp_info subflows 1 subflows 1 + chk_all_subflows 2 2 + chk_mptcp_info add_addr_signal 1 add_addr_accepted 1 + userspace_pm_rm_addr $ns1 0 + chk_rm_nr 1 0 invert + chk_rst_nr 1 1 invert + chk_mptcp_info subflows 1 subflows 1 + chk_all_subflows 1 1 + kill_events_pids + wait $tests_pid + fi } endpoint_tests()
Signature · 1 line
2.35.3
PATCH v5 8/9 selftests: mptcp: simplify checksum_tests
In reply to Geliang TangThe four checksum tests are similar, only one line is different. So a for-loop can be used to simplify these tests.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +10 -30
@@ -3029,37 +3029,17 @@ syncookies_tests() checksum_tests() { - # checksum test 0 0 - if reset_with_checksum 0 0; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi + local enable - # checksum test 1 1 - if reset_with_checksum 1 1; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi - - # checksum test 0 1 - if reset_with_checksum 0 1; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi - - # checksum test 1 0 - if reset_with_checksum 1 0; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi + for enable in "0 0" "1 1" "0 1" "1 0"; do + # checksum test 0 0, 1 1, 0 1, 1 0 + if reset_with_checksum $enable; then + pm_nl_set_limits $ns1 0 1 + pm_nl_set_limits $ns2 0 1 + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr 0 0 0 + fi + done } deny_join_id0_tests()
Signature · 1 line
2.35.3
PATCH v5 9/9 selftests: mptcp: simplify deny_join_id0_tests
In reply to Geliang TangThe six join id0 tests can be divided into three groups in sequence, with two tests in each one. Both tests in one group are similar, only different namespaces used. So a for-loop can be used to simplify these tests.
--- .../testing/selftests/net/mptcp/mptcp_join.sh | 104 ++++++++---------- 1 file changed, 46 insertions(+), 58 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_join.sh +46 -58
@@ -383,11 +383,17 @@ reset_with_checksum() reset_with_allow_join_id0() { - local ns1_enable=$2 - local ns2_enable=$3 + local ns1_enable=0 + local ns2_enable=0 reset "${1}" || return 1 + if [ "${2}" == "ns1" ]; then + ns1_enable=1 + elif [ "${2}" == "ns2" ]; then + ns2_enable=1 + fi + ip netns exec $ns1 sysctl -q net.mptcp.allow_join_initial_addr_port=$ns1_enable ip netns exec $ns2 sysctl -q net.mptcp.allow_join_initial_addr_port=$ns2_enable }
@@ -3044,65 +3050,47 @@ checksum_tests() deny_join_id0_tests() { - # subflow allow join id0 ns1 - if reset_with_allow_join_id0 "single subflow allow join id0 ns1" 1 0; then - pm_nl_set_limits $ns1 1 1 - pm_nl_set_limits $ns2 1 1 - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 - fi + local ns - # subflow allow join id0 ns2 - if reset_with_allow_join_id0 "single subflow allow join id0 ns2" 0 1; then - pm_nl_set_limits $ns1 1 1 - pm_nl_set_limits $ns2 1 1 - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi - - # signal address allow join id0 ns1 - # ADD_ADDRs are not affected by allow_join_id0 value. - if reset_with_allow_join_id0 "signal address allow join id0 ns1" 1 0; then - pm_nl_set_limits $ns1 1 1 - pm_nl_set_limits $ns2 1 1 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 - chk_add_nr 1 1 - fi - - # signal address allow join id0 ns2 - # ADD_ADDRs are not affected by allow_join_id0 value. - if reset_with_allow_join_id0 "signal address allow join id0 ns2" 0 1; then - pm_nl_set_limits $ns1 1 1 - pm_nl_set_limits $ns2 1 1 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 - chk_add_nr 1 1 - fi + for ns in "ns1" "ns2"; do + # subflow allow join id0 ns1/ns2 + if reset_with_allow_join_id0 "single subflow allow join id0 $ns" "$ns"; then + pm_nl_set_limits $ns1 1 1 + pm_nl_set_limits $ns2 1 1 + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow + run_tests $ns1 $ns2 10.0.1.1 + if [ "$ns" == "ns1" ]; then + chk_join_nr 1 1 1 + elif [ "$ns" == "ns2" ]; then + chk_join_nr 0 0 0 + fi + fi - # subflow and address allow join id0 ns1 - if reset_with_allow_join_id0 "subflow and address allow join id0 1" 1 0; then - pm_nl_set_limits $ns1 2 2 - pm_nl_set_limits $ns2 2 2 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 2 2 2 - fi + # signal address allow join id0 ns1/ns2 + # ADD_ADDRs are not affected by allow_join_id0 value. + if reset_with_allow_join_id0 "signal address allow join id0 $ns" "$ns"; then + pm_nl_set_limits $ns1 1 1 + pm_nl_set_limits $ns2 1 1 + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr 1 1 1 + chk_add_nr 1 1 + fi - # subflow and address allow join id0 ns2 - if reset_with_allow_join_id0 "subflow and address allow join id0 2" 0 1; then - pm_nl_set_limits $ns1 2 2 - pm_nl_set_limits $ns2 2 2 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 - fi + # subflow and address allow join id0 ns1/ns2 + if reset_with_allow_join_id0 "subflow & address allow join id0 $ns" "$ns"; then + pm_nl_set_limits $ns1 2 2 + pm_nl_set_limits $ns2 2 2 + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow + run_tests $ns1 $ns2 10.0.1.1 + if [ "$ns" == "ns1" ]; then + chk_join_nr 2 2 2 + elif [ "$ns" == "ns2" ]; then + chk_join_nr 1 1 1 + fi + fi + done } fullmesh_tests()
Signature · 1 line
2.35.3