summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/net/getnameinfo.39
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/libc/net/getnameinfo.3 b/src/lib/libc/net/getnameinfo.3
index 9b7e591149..a91e8896b6 100644
--- a/src/lib/libc/net/getnameinfo.3
+++ b/src/lib/libc/net/getnameinfo.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getnameinfo.3,v 1.40 2007/05/31 19:19:30 jmc Exp $ 1.\" $OpenBSD: getnameinfo.3,v 1.41 2008/12/22 12:18:56 jacekm Exp $
2.\" $KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $ 2.\" $KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $
3.\" 3.\"
4.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") 4.\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
@@ -16,7 +16,7 @@
16.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17.\" PERFORMANCE OF THIS SOFTWARE. 17.\" PERFORMANCE OF THIS SOFTWARE.
18.\" 18.\"
19.Dd $Mdocdate: May 31 2007 $ 19.Dd $Mdocdate: December 22 2008 $
20.Dt GETNAMEINFO 3 20.Dt GETNAMEINFO 3
21.Os 21.Os
22.Sh NAME 22.Sh NAME
@@ -229,12 +229,11 @@ is used
229for access control purposes: 229for access control purposes:
230.Bd -literal -offset indent 230.Bd -literal -offset indent
231struct sockaddr *sa; 231struct sockaddr *sa;
232socklen_t salen;
233char addr[NI_MAXHOST]; 232char addr[NI_MAXHOST];
234struct addrinfo hints, *res; 233struct addrinfo hints, *res;
235int error; 234int error;
236 235
237error = getnameinfo(sa, salen, addr, sizeof(addr), 236error = getnameinfo(sa, sa->sa_len, addr, sizeof(addr),
238 NULL, 0, NI_NAMEREQD); 237 NULL, 0, NI_NAMEREQD);
239if (error == 0) { 238if (error == 0) {
240 memset(&hints, 0, sizeof(hints)); 239 memset(&hints, 0, sizeof(hints));
@@ -249,7 +248,7 @@ if (error == 0) {
249 /* addr is FQDN as a result of PTR lookup */ 248 /* addr is FQDN as a result of PTR lookup */
250} else { 249} else {
251 /* addr is numeric string */ 250 /* addr is numeric string */
252 error = getnameinfo(sa, salen, addr, sizeof(addr), 251 error = getnameinfo(sa, sa->sa_len, addr, sizeof(addr),
253 NULL, 0, NI_NUMERICHOST); 252 NULL, 0, NI_NUMERICHOST);
254} 253}
255.Ed 254.Ed