diff options
| author | itojun <itojun@NetBSD.org> | 1999-11-28 14:51:04 +0000 |
|---|---|---|
| committer | itojun <itojun@NetBSD.org> | 1999-11-28 14:51:04 +0000 |
| commit | d92ae4181c972718bfa64ffec6df4874f9b17ff6 (patch) | |
| tree | f90727ba7627e8089af5b935052db66113e7e55c /lib/libpcap | |
| parent | 54f42f17fc0cbf5ad1aeb50b48f35a9367bb311d (diff) | |
restrict result from getaddrinfo() by specifying ai_socktype.
(otherwise getaddrinfo() will glob through all the possible ai_socktype
and ai_protocol)
Diffstat (limited to 'lib/libpcap')
| -rw-r--r-- | lib/libpcap/nametoaddr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libpcap/nametoaddr.c b/lib/libpcap/nametoaddr.c index 8e5a967ff49..68a75c63a12 100644 --- a/lib/libpcap/nametoaddr.c +++ b/lib/libpcap/nametoaddr.c @@ -1,4 +1,4 @@ -/* $NetBSD: nametoaddr.c,v 1.11 1999/07/02 16:03:41 simonb Exp $ */ +/* $NetBSD: nametoaddr.c,v 1.12 1999/11/28 14:51:04 itojun Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996 @@ -30,7 +30,7 @@ static const char rcsid[] = "@(#) Header: nametoaddr.c,v 1.47 97/06/13 13:16:19 leres Exp (LBL)"; #else -__RCSID("$NetBSD: nametoaddr.c,v 1.11 1999/07/02 16:03:41 simonb Exp $"); +__RCSID("$NetBSD: nametoaddr.c,v 1.12 1999/11/28 14:51:04 itojun Exp $"); #endif #endif @@ -114,6 +114,7 @@ pcap_nametoaddrinfo(const char *name) memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_DGRAM; /*not really..*/ error = getaddrinfo(name, NULL, &hints, &res); if (error) return NULL; |
