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

Fix network interface enumeration on Mono #28

Open
NattyNarwhal opened this issue Jul 7, 2018 · 6 comments
Open

Fix network interface enumeration on Mono #28

NattyNarwhal opened this issue Jul 7, 2018 · 6 comments
Labels
area: BCL This issue affects the Mono class libraries os: i This issue affects i priority; low This issue isn't too important status: blocked upstream This issue is upstream in areas beyond our control type: bug Something isn't working

Comments

@NattyNarwhal
Copy link
Member

Right now Mono can't enumerate network interfaces; it assumes none are installed. What's happening is Mono assumes in the default Unix interface enumerator class that it can list them off with getifaddrs, which isn't present under AIX, and is available in a different form with a different name under i. What can be done is writing a backend or two using SIOCGIFCONF based enumeration for AIX; and perhaps one using Qp2getifaddrs under i. (Alternatively, we could point to a wrapper library, but this is a pain.)

This is of relatively high importance because the Socket class uses these to enumerate supported network protocols; and that is used by things like DNS. Fixing this will enable a huge swath of tests under AIX CI. Right now, upstream is in the middle of refactoring this, so I don't know if I should wait for them to finish or not.

In the mean time, our binary builds supply a patch to nop out the check for interfaces in Sockets init.

@NattyNarwhal NattyNarwhal added type: bug Something isn't working os: aix This issue affects AIX os: i This issue affects i area: BCL This issue affects the Mono class libraries labels Jul 7, 2018
@kadler
Copy link

kadler commented Jul 9, 2018

FYI, we have some code which implements a getifaddrs shim for PASE already that we're looking at open sourcing. I'm not sure if the same would work on AIX, though.

@NattyNarwhal
Copy link
Member Author

Is that the same as Qp2getifaddrs? I know rsyslog implements a shim.

I have a SIOCGIFCONF based implementation of NetworkInterface running on AIX, but I haven't tested it under PASE yet. I assume it'd work except for maybe MTUs, but the incongruency between the ioctl and getifaddrs/if_nameindex functions for device names is annoying and prevents me from getting the index; not essential for the class I implemented but other stuff like in CoreFX PAL really wants the index. It seems the ioctl on AIX returns AF_LINK containing sockaddr_dls, but not under PASE, so that's not a workaround. Is there another method perhaps?

Interestingly, all methods seem to return the same stuff regardless of PASE or ILE.

@kadler
Copy link

kadler commented Jul 9, 2018

No, it's through a different method and uses neither Qp2getifaddrs nor SIOCGIFCONF

@NattyNarwhal
Copy link
Member Author

@kadler do you know what interface that was? I was skimming through AIX headers a while back and I noticed some interfaces for querying, but they didn't have any documentation and some seemed to be kernel internals related...

@NattyNarwhal
Copy link
Member Author

An attempt but upstream is hesitant due to a future refactor Real Soon Now™.

@NattyNarwhal NattyNarwhal added priority: high This issue must be dealt with urgently status: blocked upstream This issue is upstream in areas beyond our control labels Jul 9, 2018
@NattyNarwhal NattyNarwhal added priority; low This issue isn't too important and removed os: aix This issue affects AIX priority: high This issue must be dealt with urgently labels Nov 29, 2018
@NattyNarwhal
Copy link
Member Author

Upstream has merged the AIX patch for now. It won't work 100% on i, but enough to omit a patch. When upstream works on importing CoreFX NetworkInterface, I have an idea of the interface to use instead that works properly on both AIX and i.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: BCL This issue affects the Mono class libraries os: i This issue affects i priority; low This issue isn't too important status: blocked upstream This issue is upstream in areas beyond our control type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants