All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next 1/2] Squash to "mptcp: set fullmesh flag in pm_netlink"
@ 2022-01-11  8:37 Geliang Tang
  2022-01-11  8:37 ` [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add fullmesh setting tests" Geliang Tang
  2022-01-11  8:37 ` [PATCH iproute2-next] Squash to "mptcp: add the fullmesh flag setting support" Geliang Tang
  0 siblings, 2 replies; 3+ messages in thread
From: Geliang Tang @ 2022-01-11  8:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

Add the fullmesh flag check for set_flags.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/pm_netlink.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 1cdaa774cafc..b4d7ba265529 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1765,6 +1765,9 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
 		if ((!lookup_by_id && addresses_equal(&entry->addr, &addr.addr, true)) ||
 		    (lookup_by_id && entry->addr.id == addr.addr.id)) {
 			if (fullmesh) {
+				if (entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL)
+					return -EINVAL;
+
 				mptcp_nl_remove_subflow_and_signal_addr(net, &entry->addr);
 				if (addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH)
 					entry->flags |= MPTCP_PM_ADDR_FLAG_FULLMESH;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add fullmesh setting tests"
  2022-01-11  8:37 [PATCH mptcp-next 1/2] Squash to "mptcp: set fullmesh flag in pm_netlink" Geliang Tang
@ 2022-01-11  8:37 ` Geliang Tang
  2022-01-11  8:37 ` [PATCH iproute2-next] Squash to "mptcp: add the fullmesh flag setting support" Geliang Tang
  1 sibling, 0 replies; 3+ messages in thread
From: Geliang Tang @ 2022-01-11  8:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

Now we can set both backup and fullmesh flags, so avoid using the words
'backup' and 'bkup'.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 2868e2657ca1..13be3cd142ef 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -467,8 +467,7 @@ do_transfer()
 			dump=(`ip netns exec $netns ./pm_nl_ctl dump`)
 			if [ ${#dump[@]} -gt 0 ]; then
 				addr=${dump[${#dump[@]} - 1]}
-				backup="ip netns exec $netns ./pm_nl_ctl set $addr flags $sflags"
-				$backup
+				ip netns exec $netns ./pm_nl_ctl set $addr flags $sflags
 			fi
 		done
 	fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH iproute2-next] Squash to "mptcp: add the fullmesh flag setting support"
  2022-01-11  8:37 [PATCH mptcp-next 1/2] Squash to "mptcp: set fullmesh flag in pm_netlink" Geliang Tang
  2022-01-11  8:37 ` [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add fullmesh setting tests" Geliang Tang
@ 2022-01-11  8:37 ` Geliang Tang
  1 sibling, 0 replies; 3+ messages in thread
From: Geliang Tang @ 2022-01-11  8:37 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

Add the fullmesh flag check for the adding address too.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 ip/ipmptcp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c
index ee786537..646e5200 100644
--- a/ip/ipmptcp.c
+++ b/ip/ipmptcp.c
@@ -118,6 +118,11 @@ static int mptcp_parse_opt(int argc, char **argv, struct nlmsghdr *n, int cmd)
 	ll_init_map(&rth);
 	while (argc > 0) {
 		if (get_flags(*argv, &flags) == 0) {
+			if (adding &&
+			    (flags & MPTCP_PM_ADDR_FLAG_SIGNAL) &&
+			    (flags & MPTCP_PM_ADDR_FLAG_FULLMESH))
+				invarg("invalid flags\n", *argv);
+
 			/* allow changing the 'backup' flag only */
 			if (cmd == MPTCP_PM_CMD_SET_FLAGS &&
 			    (flags & ~MPTCP_PM_ADDR_FLAG_BACKUP) &&
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-11  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  8:37 [PATCH mptcp-next 1/2] Squash to "mptcp: set fullmesh flag in pm_netlink" Geliang Tang
2022-01-11  8:37 ` [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add fullmesh setting tests" Geliang Tang
2022-01-11  8:37 ` [PATCH iproute2-next] Squash to "mptcp: add the fullmesh flag setting support" Geliang Tang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.