switchbrew / libnx

Library for Switch Homebrew
https://switchbrew.github.io/libnx/
ISC License
1.26k stars 167 forks source link

ipv6: in.h extended #640

Open XITRIX opened 6 months ago

XITRIX commented 6 months ago

To be able to use MDNS lib I had to add header for ipv6 address structure

WinterMute commented 6 months ago

fwiw the switch network stack doesn't support ipv6 so there isn't really much point in dns providing ipv6 addresses. You might be better off looking at making ipv6 support optional in that lib instead.

XITRIX commented 6 months ago

Yes, it does not support it, but in terms of portability and maintainability I'd prefer to be able to compile non modified version of library, than forking it and doing any modifications just for Switch. I'm making cross platform app, so it will be a really painful if I'll need to do it for each platform like this, than just add missing headers and allow it to build without any problems

WinterMute commented 6 months ago

Yes, it does not support it, but in terms of portability and maintainability I'd prefer to be able to compile non modified version of library, than forking it and doing any modifications just for Switch. I'm making cross platform app, so it will be a really painful if I'll need to do it for each platform like this, than just add missing headers and allow it to build without any problems

The switch isn't the only system around which doesn't support ipv6. It would seem reasonable to upstream a patch there to allow building without ipv6 support. That would be my recommended option here rather than adding things to libnx headers.

XITRIX commented 6 months ago

Maybe you are right, I just saw some structures for ipv6 already presented in switch headers, and this was the only one missing to be able to successfully compile and run this lib for Switch, but I just checked the solution for this lib on PSVita, and as you said, they forked this library and added IPV6_UNSUPPORTED definition for vita around ipv6 related functions