[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200907201014.18063.remi.denis-courmont@nokia.com>
Date: Mon, 20 Jul 2009 10:14:17 +0300
From: "Rémi Denis-Courmont"
<remi.denis-courmont@...ia.com>
To: ext Zsolt SZALAI <zs.szalai@...il.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: getaddrinfo - too many recvmsg calls
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists