WSL: ifaddrs.h: getifaddrs() causing invalid argument exception.

Hi. In alignement with my explorations today, it appears that ifaddrs.h is not fully implemented, or there is some other bug. Whenever one attempts to call getifaddrs(), errno is set to EINVAL.

This is causing issues in #134 and is probably just as related to #69 as anything else is. Furthermore, this is the reason why almost all of the LibZMQ tests seem to be failing. I’ve attached the test suite output after building libzmq and running make check. Finally this is causing errors with Anaconda, in particular the iPython or Jupyter notebook projects cannot use sockets to communicate between the browser and the iPython kernel, this is seen in this issue #1331.

The following code replicates the error:

#include <ifaddrs.h>
#include <iostream>
#include <errno.h>

int main(){
    ifaddrs *p = 0;
    int rc = getifaddrs(&p);

    std::cout << "Succeded ? " << rc << "\n";

    if(rc == -1){
        if(errno == 22)
            std::cout << "Invalid argument exception.";
    }

    std::cin.get();
    return 0;

}

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Reactions: 10
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

The teredo issue should be fixed in 15007