Repository navigation
feat(nx-rt-core): answer where the console can be reached - #170
Merged
Merged
Conversation
A program that tells a host how to reach it has to know its own address, and the network-interface service is what answers. Asking needs the service-manager session a process gets exactly one of, which is why the symbol sits at the runtime rather than beside the socket driver. - `gethostid` opens a `nifm:u` session, asks for the current address, and closes it again: the answer changes whenever the console joins or leaves a network, so there is nothing worth keeping between calls - Which command opens the general-service sub-interface follows the running firmware, renumbered in HOS 3.0.0, and the firmware version is held here - Every failure answers with the loopback address rather than reporting, because the C signature has no way to say "no answer" and a caller asking where it can be reached is better served by the address that always works - It sits with the other network-interface work under `use_nx_sys_net` rather than with the resolver overrides it neighbours upstream: it asks `nifm`, not `sfdnsres`, and that option already carries the dependency - `gethostname` is left to libnx, whose body calls `gethostid` and so reaches this through the alias Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A program that tells a host how to reach it has to know its own address, and the network-interface service is what answers. Asking needs the service-manager session a process gets exactly one of, which is why the symbol sits at the runtime rather than beside the socket driver.
gethostidopens anifm:usession, asks for the current address, and closes it again: the answer changes whenever the console joins or leaves a network, so there is nothing worth keeping between callsuse_nx_sys_netrather than with the resolver overrides it neighbours upstream: it asksnifm, notsfdnsres, and that option already carries the dependencygethostnameis left to libnx, whose body callsgethostidand so reaches this through the alias