Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 692823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:41:26+00:00 2026-05-14T02:41:26+00:00

I am facing a strange problem on my Ubuntu Karmic system. When I call

  • 0

I am facing a strange problem on my Ubuntu Karmic system.

When I call getaddrinfo() with AI_PASSIVE and AF_UNSPEC, for an empty host and the UDP 12000 port to get a bindable address, I only get back one IPv4 result (0.0.0.0:12000 for instance).

If I change my call and specify AF_INET6 instead of AF_UNSPEC, then getaddrinfo() returns "Name or service not known".

Shouldn’t I get [::]:12000 as a result ?

The same thing happens if I set the host to ::1.

When I call getaddrinfo() without AI_PASSIVE (to get a "connectable" address) for the host "localhost" and the UDP 12000 port, I first get [::1]:12000 then 127.0.0.1:12000.

So apparently, my system is IPv6 ready (I can ping to both IPv4 and IPv6 addresses, as well as DNS resolution). But how is it that I can’t get an IPv6 address to bind to with getaddrinfo() ?

Do you guys have any idea about what could be wrong ?

My OS is Ubuntu Karmic, fresh install without any networking tweaking.

Thank you.

P.S: If you have no idea but still want to help me, you can get this sample program or type:

wget http://people.apache.org/~jorton/gai.c

And give me the result of:

$ ./gai -ap null 12000

My result is:

$ ./gai -ap null 12000

getaddrinfo(NULL, "12000", {.family=AF_UNSPEC, .hints=0|AI_ADDRCONFIG|AI_PASSIVE}) = 0:

family= 2, proto= 6 inet4: addr=0.0.0.0, port=12000

There you can see that I only have one IPv4 result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:41:26+00:00Added an answer on May 14, 2026 at 2:41 am

    This happens on new systems that use eglibc: debian-glibc.

    Apparently, there is a bug that requires you to set at least one valid IPv6 address to one of your network interfaces (the loopback doesn’t count).

    After I did this:

    $ sudo ip -6 addr add 2001:660:4701:1001::1 dev eth0

    I have:

    $ ./gai -ap null 12000

    getaddrinfo(NULL, "12000", {.family=AF_UNSPEC, .hints=0|AI_ADDRCONFIG|AI_PASSIVE}) = 0:

    family= 2, proto= 6 inet4: addr=0.0.0.0, port=12000

    family=10, proto= 6 inet6: addr=::, port=12000, flowinfo=0

    I hope this can help someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing strange problem, Whenever I commented second if condition, it works in
I'm facing this strange problem. I'm trying to read a file that is located
I am facing a strange problem while sorting a list of strings with integer
I am facing this strange problem while working with Generic Base Classes. I am
I am facing this strange problem with the following section of code <% if
I am facing a strange problem with my iphone. It shows available memory as
I am facing a strange problem with AVAudioRecorder. In my application i need to
I am facing a strange problem . When i single click on my files
I'm facing a strange problem with NSUsrDefaults. Whenever I'm fetching the data from NSUserDefaults,
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.