Skip to content

ifaddrs.h: getifaddrs() causing invalid argument exception. #308

Description

@MadcowD

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;

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions