#419 Solaris 10 doesn't have "ifaddrs.h"

Reporter jcea@jcea.es
Owner MattJ
Created
Updated
Stars ★★ (2)  
Tags
  • Milestone-0.9
  • Type-Defect
  • Status-Accepted
  • Priority-Medium
  • util.net
  1. jcea@jcea.es on

    Solaris 10 doesn't have "ifaddrs.h" neither, of course, "getifaddrs()" function. So, compilation fails. Checking the source code I see that in Windows you doesn't use "getifaddrs()" funcion and just returns "0.0.0.0" IP address. I wonder about what that means and it would be enough to just do the same under Solaris 10. I could contribute with a patch in that case, detecting Solaris 10 in "configure".

  2. Waqas on

    Thanks for the report! Solaris 11 adds this function apparently, while Solaris 10 and below do not. We've had Solaris compatibility patches before, usually with an #ifdef check, e.g., > #if !(defined(sun) || defined(__sun)) An expanded check similar to this in util-src/net.c with version detection would be ideal, but I have no idea what macros are defined on Solaris.

    Changes
    • owner MattJ
    • tags Status-Accepted
  3. jcea@jcea.es on

    Yes, Solaris 11 has this. But Solaris 10 will supported by Oracle until 2021 :-). There is no macro saying what Solaris version your are compiling in, but it could be done in "configure" (reading "uname" output) or a new target like "./configure ostype=solaris10".

  4. MattJ on

    I like the idea of a new ostype. Marking this for 0.9. Patches welcome :) Otherwise I'll probably get to this when we're preparing the next release.

    Changes
    • tags Milestone-0.9
  5. jcea@jcea.es on

    What is the impact of returning "0.0.0.0" (like Windows version does) instead of the real list of interfaces (the unixes)?

  6. Zash on

    Does https://hg.prosody.im/0.9/rev/63f5870f9afe help with this issue?

  7. Zash on

    Changes
    • tags util.net

New comment