Skip to content

Commit

Permalink
Use dev in mptcp endpoint add
Browse files Browse the repository at this point in the history
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. (svinota/pyroute2#782)
  • Loading branch information
Kuba314 committed Jan 16, 2024
1 parent 509932d commit 667df39
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lnst/Recipes/ENRT/MPTCPRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand All @@ -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"
Expand Down

0 comments on commit 667df39

Please sign in to comment.