dect
/
libpcap
Archived
13
0
Fork 0

some getaddrinfo(3) can return multiple address against SOCK_STREAM (like tcp

adn sctp).  hardcode to tcp for now.  suz@kame
This commit is contained in:
itojun 2003-12-24 08:27:04 +00:00
parent 86c7fc47a5
commit 08ef9a54d2
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.71 2003-11-19 18:14:18 guy Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.72 2003-12-24 08:27:04 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -124,6 +124,7 @@ pcap_nametoaddrinfo(const char *name)
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM; /*not really*/
hints.ai_socktype = IPPROTO_TCP; /*not really*/
error = getaddrinfo(name, NULL, &hints, &res);
if (error)
return NULL;