Skip to content
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

[faux-mgs] Add --sp-sim-addr CLI flag #343

Merged
merged 1 commit into from
Feb 10, 2025
Merged

Conversation

jgallagher
Copy link
Collaborator

Trying to use faux-mgs to talk to sp-sim running on localhost fails in a confusing way where sp-sim gets packets from faux-mgs, but faux-mgs rejects the response because they come back with a scope ID of 0:

$ faux-mgs --interface lo --discovery-addr '[::1]:33300' discover
Feb 06 22:59:04.587 INFO creating SP handle on interface lo, component: faux-mgs
Feb 06 22:59:04.588 WARN failed to look up interface for peer; discarding packet, error: no interface name found for index 0, peer: [::1]:33300, component: faux-mgs

I think this is because scope IDs are only provided for link-local addresses? The behavior here is the same on Linux and illumos.

This PR adds a new flag specifically for talking to the simulator, which goes through the test path we created for MGS to do this same thing:

$ faux-mgs --sp-sim-addr '[::1]:33300' discover
Feb 07 19:19:05.363 INFO creating SP handle on to talk to SP simulator at [::1]:33300, component: faux-mgs
Feb 07 19:19:05.363 INFO initial discovery complete, addr: [::1]:33300, component: faux-mgs
Feb 07 19:19:05.363 INFO SP discovered, port: One, addr: [::1]:33300, interface: (direct socket handle), component: faux-mgs
addr=[::1]:33300, port=One

@jgallagher jgallagher requested a review from jmpesp February 7, 2025 19:24
@jgallagher jgallagher merged commit d935c87 into main Feb 10, 2025
10 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