Hi Vincent,
sorry for being late with my response. Basically I'm confident that the ioctl(fd, SIOCGIFADDR, &ifr) will work on every interface the Linux kernel knows of. But not
all interfaces have an IPv4 address. Especially your wording about "a fallback ip on enp0s31f6" sounds to me that this interface is not a "normal" interface.
I would propose two things to get a clue what is going on:
a) Please add a printout of the errno value after the ioctl() call in the function GetIpAndNetmaskFromInterface(). A perror() call before the close() call of line 77
should suffice.
b) To show us how your system is really configured you may use the example code for getifaddrs() that is included in the man page of getifaddrs(). Put it into
a source file, compile it and then run it in parallel to OpENer on the machine where the OpENer runs. That will show us what you would see with getifaddrs().
I guess that the interface enp0s31f6 has no IPv4 address at that moment when OpENer runs.
Best regards,
Stefan