From 667df393754770a31dbb12d2ce677fd0cd35b0b7 Mon Sep 17 00:00:00 2001 From: Jakub Rozek Date: Tue, 28 Nov 2023 15:43:40 +0100 Subject: [PATCH] Use dev in mptcp endpoint add Apparently there's a difference between "adding an mptcp endpoint" and "adding an mptcp endpoint to a device". pyroute doesn't support dev in the `mptcp endpoint add` call so we have to use a shell command. (https://github.com/svinota/pyroute2/issues/782) --- lnst/Recipes/ENRT/MPTCPRecipe.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lnst/Recipes/ENRT/MPTCPRecipe.py b/lnst/Recipes/ENRT/MPTCPRecipe.py index e5ca51e51..89d7f7063 100644 --- a/lnst/Recipes/ENRT/MPTCPRecipe.py +++ b/lnst/Recipes/ENRT/MPTCPRecipe.py @@ -6,7 +6,7 @@ from lnst.Common.IpAddress import interface_addresses from lnst.Controller import HostReq, DeviceReq, RecipeParam from lnst.Controller.Host import Host -from lnst.RecipeCommon.MPTCPManager import MPTCPManager, MPTCPFlags +from lnst.RecipeCommon.MPTCPManager import MPTCPManager from lnst.RecipeCommon.Ping.PingEndpoints import PingEndpoints from lnst.RecipeCommon.endpoints import EndpointPair, IPEndpoint from lnst.Recipes.ENRT.helpers import ip_endpoint_pairs @@ -96,7 +96,11 @@ def test_wide_configuration(self): # Configure endpoints only host1.eth1 if "ipv4" in self.params.ip_versions: - host1.mptcp.add_endpoints(config.ips_for_device(host1.eth1, family=AF_INET), flags=MPTCPFlags.MPTCP_PM_ADDR_FLAG_SUBFLOW) + host1.run( + f"ip mptcp endpoint add {save_addrs[host1.eth1][AF_INET]}" + f" dev {host1.eth1.name} subflow" + ) + # Need route on client side to populate forwarding table host1.run( f"ip route add {self.params.net1_ipv4} dev {host1.eth1.name}" @@ -111,7 +115,10 @@ def test_wide_configuration(self): host.run(f"sysctl -w net.ipv4.conf.{host.eth1.name}.rp_filter=0") if "ipv6" in self.params.ip_versions: - host1.mptcp.add_endpoints(config.ips_for_device(host1.eth1, family=AF_INET6), flags=MPTCPFlags.MPTCP_PM_ADDR_FLAG_SUBFLOW) + host1.run( + f"ip mptcp endpoint add {save_addrs[host1.eth1][AF_INET6]}" + f" dev {host1.eth1.name} subflow" + ) host1.run( f"ip route add {self.params.net1_ipv6} dev {host1.eth1.name}" f" via {save_addrs[host2.eth1][AF_INET6]} prio 10000"