-
Notifications
You must be signed in to change notification settings - Fork 826
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
unable to list/enumarate network interfaces through any means #136
Comments
what's the error? probably a duplicate of #118 |
Yes, this looks like #118, #69 and few other network related posts. We are aware of the lack of support for NETLINK sockets and are looking into it, based on the feedback provided through the wpdev portal. Please provide your feedback\up vote feature requests @ https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo |
I think it likely resolve to the same thing. "Error 22, invalid argument." As it is with issue 118, the python is really just calling into a shared library that is querying the network layer...so our failures are probably from the same source, which is also why netstat and "ifconfig" fail as well. The error number probably comes from the failure of the underlying .so to return a python list but am not certain. at the CC level I sure we just have a failure on the function that queries the network layer. For completeness, here is the .C code for hat netifaces in python is calling into: static PyObject * #if defined(WIN32) /* First, retrieve the adapter information */
} while (dwRet == ERROR_BUFFER_OVERFLOW); /* If we failed, then fail in Python too */
} result = PyList_New(0); if (dwRet == ERROR_NO_DATA) { for (pInfo = pAdapterAddresses; pInfo; pInfo = pInfo->Next) {
} free (pAdapterAddresses); result = PyList_New (0); if (getifaddrs (&addrs) < 0) { for (addr = addrs; addr; addr = addr->ifa_next) {
} freeifaddrs (addrs); if (fd < 0) { // Try to find out how much space we need // As a last resort, guess ifc.CNAME(ifc_len) = (int)(len * sizeof (struct CNAME(ifreq))); if (!ifc.CNAME(ifc_buf)) { #if HAVE_SIOCGLIFNUM result = PyList_New (0);
#if !HAVE_SOCKADDR_SA_LEN free (ifc.CNAME(ifc_buf)); return result; |
Looks like there is already a post in wpdev tracking this. Feel free to add your vote there: |
There seems to be no way to enumerate networking interfaces. While I understand we can not and shouldn't be accessing raw sockets, it is nonetheless a common task to explore, via bash, what interfaces you have. So, in addition to standard command line utils not working (ifconfig , "netstat" , "ip link") the real concern is that most python scripts that relay on this ability will fail. This python code for example:
import netifaces
netifaces.interfaces()
Fails. This is going to nullify a lot of scripts out there who need to iterate through available interfaces. Again, this is not to do anything low level, but it is a common procedure that a ton of legacy relies on. Hopefully this will be added?
The text was updated successfully, but these errors were encountered: