diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2008-12-22 12:18:57 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2008-12-22 12:18:57 +0000 |
commit | 196112a6deafcb350fa2cdac09c29b429fa9905b (patch) | |
tree | 5bb07d8d8a04440778497797332675cae5e346fb /lib/libc | |
parent | a9c6a0667f0223951ae6aa0600382bdf1c33f3e3 (diff) |
The example for detecting malicious PTR records could be easily misinterpreted.
Make it less ambiguous; ok gilles@ claudio@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/getnameinfo.3 | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libc/net/getnameinfo.3 b/lib/libc/net/getnameinfo.3 index 9b7e5911491..a91e8896b65 100644 --- a/lib/libc/net/getnameinfo.3 +++ b/lib/libc/net/getnameinfo.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getnameinfo.3,v 1.40 2007/05/31 19:19:30 jmc Exp $ +.\" $OpenBSD: getnameinfo.3,v 1.41 2008/12/22 12:18:56 jacekm Exp $ .\" $KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $ .\" .\" Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -16,7 +16,7 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: December 22 2008 $ .Dt GETNAMEINFO 3 .Os .Sh NAME @@ -229,12 +229,11 @@ is used for access control purposes: .Bd -literal -offset indent struct sockaddr *sa; -socklen_t salen; char addr[NI_MAXHOST]; struct addrinfo hints, *res; int error; -error = getnameinfo(sa, salen, addr, sizeof(addr), +error = getnameinfo(sa, sa->sa_len, addr, sizeof(addr), NULL, 0, NI_NAMEREQD); if (error == 0) { memset(&hints, 0, sizeof(hints)); @@ -249,7 +248,7 @@ if (error == 0) { /* addr is FQDN as a result of PTR lookup */ } else { /* addr is numeric string */ - error = getnameinfo(sa, salen, addr, sizeof(addr), + error = getnameinfo(sa, sa->sa_len, addr, sizeof(addr), NULL, 0, NI_NUMERICHOST); } .Ed |