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 992c296
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lnst/Recipes/ENRT/MPTCPRecipe.py
Original file line number Diff line number Diff line change
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 992c296

Please sign in to comment.