# Can I call net:getaddrinfo with AI\_PASSIVE flag?

**URL:** <https://erlangforums.com/t/can-i-call-net-getaddrinfo-with-ai-passive-flag/2415>\
**Category:** Questions / Help\
**Tags:** erlang-otp\
**Created:** [February 28, 2023, 2:33pm UTC](https://erlangforums.com/t/can-i-call-net-getaddrinfo-with-ai-passive-flag/2415 "2023-02-28T14:33:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![toshi0806](https://erlangforums.com/user_avatar/erlangforums.com/toshi0806/32/1877_2.png) [@toshi0806](https://erlangforums.com/u/toshi0806)\
**Post date:** [February 28, 2023, 2:33pm UTC](https://erlangforums.com/t/can-i-call-net-getaddrinfo-with-ai-passive-flag/2415/1 "2023-02-28T14:33:16Z")

</div>

Can I call getaddrinfo with AI\_PASSIVE flag?

I try to make IPv4/IPv6 dualstack server. So, I want to call net:getaddrinfo with AI\_PASSIVE flag. But, net:getaddrinfo/1 and net:getaddrinfo/2 may not accept hints parameters.

Are there any way to call getaddrinfo with AI\_PASSIVE flag?

---

<div class="post-metadata">

**Author:** ![jj1bdx](https://erlangforums.com/user_avatar/erlangforums.com/jj1bdx/32/278_2.png) [@jj1bdx](https://erlangforums.com/u/jj1bdx)\
**Post date:** [September 10, 2024, 6:18am UTC](https://erlangforums.com/t/can-i-call-net-getaddrinfo-with-ai-passive-flag/2415/2 "2024-09-10T06:18:33Z")

</div>

So far passing any (including `AI_PASSIVE`) hints/flags is not supported at all in `nif_getaddrinfo()` of `erts/emulator/nifs/common/prim_net_nif.c` (at least in the master branch as of 9-SEP-2024).  
There’s no way to pass any hints since `net:getaddrinfo/{1,2}` have no way to do it.  
I guess you need to write `net:getaddrinfo/3` to pass a hint (including `AI_PASSIVE`) and other hints, as well as corresponding code of `prim_net:getaddrinfo` and the NIF code of `prim_net`.
