netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
To: ext Zsolt SZALAI <zs.szalai@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: getaddrinfo - too many recvmsg calls
Date: Mon, 20 Jul 2009 10:14:17 +0300	[thread overview]
Message-ID: <200907201014.18063.remi.denis-courmont@nokia.com> (raw)
In-Reply-To: <dffc28000907200005p7effca1cif4060b15be99e84@mail.gmail.com>

On Monday 20 July 2009 10:05:56 ext Zsolt SZALAI wrote:
> The sanitycheck is now really simple, just a
>     addrinfo hints = { 0, AF_INET, 0, 0, 0, NULL, NULL, NULL };
>     int result = getaddrinfo(ipAddress, NULL, &hints, &addresses);
> call.

What the heck is this supposed to do?
This piece of code tries to resolve <ipAddress> as numerical IPv4 address *or* 
a DNS hostname.

If you want to check that a string is a valid IP address, call inet_pton(). If 
you want to check that an IP address is assigned to the system, create a 
socket and bind to that address.

-- 
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki


  reply	other threads:[~2009-07-20  7:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-20  7:05 getaddrinfo - too many recvmsg calls Zsolt SZALAI
2009-07-20  7:14 ` Rémi Denis-Courmont [this message]
2009-07-20  7:55   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200907201014.18063.remi.denis-courmont@nokia.com \
    --to=remi.denis-courmont@nokia.com \
    --cc=netdev@vger.kernel.org \
    --cc=zs.szalai@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).