Skip to content

Detect change on network interface to update locators and scouting #1824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Hugal31
Copy link
Contributor

@Hugal31 Hugal31 commented Mar 12, 2025

On Unix systems, use netlink to detect added or delete IPv4 addresses to:

  • Renew the interface list.
  • Update the node locators.
  • Restart the scouting to use the new addresses/discard the old addresses.

This is still quite hacky, with the following shortcomings:

  • We do not handle IPv6 addresses, because the IPv6 addresses are "renewed" every few seconds, causing unecessary closing and re-opening of the sockets.
  • We perform the locator update and the scouting reset even if the new/old addresses are not used as per the configuration.
  • Only works on Linux because of the Netlink dependency.
  • The code overall is not the best quality.

This would solve #1823 (with the mentioned caveats).

Feel free to close this, I opened it more for reference and I might not update it.

Copy link

PR missing one of the required labels: {'bug', 'internal', 'breaking-change', 'new feature', 'documentation', 'enhancement', 'dependencies'}

@jean-roland jean-roland added the enhancement Existing things could work better label Mar 12, 2025
@Hugal31
Copy link
Contributor Author

Hugal31 commented Mar 13, 2025

A few changes:

  • I did a bigger refactor to extract the scouting procedure.
  • I completely ignore IPv6 changes.
  • I now only open/close socket that are missing/no longer working because of the interface up/down, instead of closing and re-opening everything.

There's an additional caveat, the "reset" of the scouting routine may interrupt something important (e.g. the connection to a peer).

@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 5d2a194 to 3d7c115 Compare March 13, 2025 17:00
@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 3d7c115 to 8dc2681 Compare April 2, 2025 08:10
Hugo Laloge added 9 commits April 7, 2025 09:41
On Unix systems, use netlink to detect added or delete IPv4 addresses to:
  * Renew the interface list.
  * Update the node locators.
  * Restart the scouting to use the new addresses/discard the old addresses.

This is still quite hacky, with the following shortcommings:
* We do not handle IPv6 addresses.
* We perform the locator update and the scouting reset even if the
  new/old addresses are not used as per the configuration.
* The code overall is not the best quality.
Remove the scouting reset upon interface change.
This is in preparation of an improvemnt of the scouting update upon interface change.
@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 8dc2681 to 8c686fe Compare April 7, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Existing things could work better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants