diff options
author | jacekm <> | 2008-12-22 12:18:56 +0000 |
---|---|---|
committer | jacekm <> | 2008-12-22 12:18:56 +0000 |
commit | 4840888f971b6915e7fe1f599c97149e6ab0985f (patch) | |
tree | 9fad4e224146b56ee09ee66d8e7a6475df1f0d5a /src | |
parent | e31e6e662a88e257063cc2372c7c2e5aec3480ae (diff) | |
download | openbsd-4840888f971b6915e7fe1f599c97149e6ab0985f.tar.gz openbsd-4840888f971b6915e7fe1f599c97149e6ab0985f.tar.bz2 openbsd-4840888f971b6915e7fe1f599c97149e6ab0985f.zip |
The example for detecting malicious PTR records could be easily misinterpreted.
Make it less ambiguous; ok gilles@ claudio@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/net/getnameinfo.3 | 9 |
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 | |||
229 | for access control purposes: | 229 | for access control purposes: |
230 | .Bd -literal -offset indent | 230 | .Bd -literal -offset indent |
231 | struct sockaddr *sa; | 231 | struct sockaddr *sa; |
232 | socklen_t salen; | ||
233 | char addr[NI_MAXHOST]; | 232 | char addr[NI_MAXHOST]; |
234 | struct addrinfo hints, *res; | 233 | struct addrinfo hints, *res; |
235 | int error; | 234 | int error; |
236 | 235 | ||
237 | error = getnameinfo(sa, salen, addr, sizeof(addr), | 236 | error = getnameinfo(sa, sa->sa_len, addr, sizeof(addr), |
238 | NULL, 0, NI_NAMEREQD); | 237 | NULL, 0, NI_NAMEREQD); |
239 | if (error == 0) { | 238 | if (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 |