diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2015-11-16 17:11:11 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2015-11-16 17:11:11 +0000 |
commit | 68b3fb6aaf3a793d87f8bcfc7e75c1a9e0849688 (patch) | |
tree | 99ad9cff7b5f10f7a9b0d7ab60adfbb56528bfd5 /usr.sbin | |
parent | 84a8f489f2e344845c1584364c1227b903f4a4ec (diff) | |
download | FreeBSD-src-68b3fb6aaf3a793d87f8bcfc7e75c1a9e0849688.zip FreeBSD-src-68b3fb6aaf3a793d87f8bcfc7e75c1a9e0849688.tar.gz |
Do not use SA_LEN() to dereference sa_len.
FreeBSD lacks the SA_LEN() macro.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ypldap/ldapclient.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ypldap/ldapclient.c b/usr.sbin/ypldap/ldapclient.c index f6eb544..e95585a 100644 --- a/usr.sbin/ypldap/ldapclient.c +++ b/usr.sbin/ypldap/ldapclient.c @@ -71,14 +71,14 @@ client_aldap_open(struct ypldap_addr *addr) char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; struct sockaddr *sa = (struct sockaddr *)&p->ss; - if (getnameinfo(sa, SA_LEN(sa), hbuf, sizeof(hbuf), sbuf, + if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV)) errx(1, "could not get numeric hostname"); if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) < 0) return NULL; - if (connect(fd, sa, SA_LEN(sa)) == 0) + if (connect(fd, sa, sa->sa_len) == 0) break; warn("connect to %s port %s (%s) failed", hbuf, sbuf, "tcp"); |