Skip to content

Conversation

@eklabn
Copy link
Contributor

@eklabn eklabn commented Jun 29, 2023

Here are a couple of changes to (1) handle interface addresses with /32 masks and (2) create a dummy for each unconnected interface.

@choppsv1 choppsv1 force-pushed the main branch 2 times, most recently from 91b4758 to eb56767 Compare August 9, 2023 04:23
@choppsv1 choppsv1 force-pushed the main branch 2 times, most recently from 741d071 to 7a41244 Compare September 14, 2024 03:15
@eklabn eklabn force-pushed the ekinzie/ip-p2p branch 5 times, most recently from e5b6180 to e365d1d Compare December 29, 2025 21:18
@eklabn eklabn requested a review from liambrady December 29, 2025 21:19
@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

❌ Patch coverage is 77.90698% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.62%. Comparing base (bfee4d5) to head (58e72ab).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
munet/native.py 76.27% 14 Missing ⚠️
munet/base.py 81.48% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   60.16%   60.62%   +0.45%     
==========================================
  Files          19       19              
  Lines        5879     5973      +94     
==========================================
+ Hits         3537     3621      +84     
- Misses       2342     2352      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@liambrady liambrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In line with some of my comments, can you split these two commits into two separate PRs?

I am happy to push through the /32 address support changes, but don't yet want to merge the unconnected interface changes until I can work on a proper solution for configuring parallel p2p connections.

EDIT: Ignore my previous comment, you can keep both of these commits in this PR.

munet/native.py Outdated
and ifaddr.network != oifaddr.network
):
con.cmd_raises(
f"ip addr add {ifaddr} peer {oifaddr.ip} dev {ifname}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You drop the peer's network mark here, which is the opposite of what you did in _set_p2p_addr (where you instead kept the peer's network mask and instead dropped the address's mask). Is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I have made these consistent and use the peer's network in all cases. For /32 and /128 prefixes this is effectively no change. For shorter masks, the peer parameter is always a valid prefix.

munet/native.py Outdated
and ifaddr.network != oifaddr.network
):
con.cmd_raises(
f"ip addr add {ifaddr} peer {oifaddr.ip} dev {ifname}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question as above

@@ -0,0 +1,28 @@
version: 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this test to the tests/config directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem - moved

@@ -0,0 +1,31 @@
version: 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this test to the tests/config directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also moved.

For p2p links with each endpoint in a different IP subnet, as would be
found with IPv4 addresses and 32-bit subnet masks, configure the peer
address.  In Linux, adding an interface route with the peer's address
as the destination is not sufficient; no other route will be able to
use the peer's address as a next-hop.
An interface with no connection is currently omitted from the target
network namespace.  Instead, add a Linux "dummy" interface and assign
IP addresses.
Copy link
Contributor

@liambrady liambrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liambrady liambrady merged commit 8bbbd4f into LabNConsulting:main Jan 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants