Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Nov 2015 17:11:11 +0000 (UTC)
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r290940 - head/usr.sbin/ypldap
Message-ID:  <201511161711.tAGHBBxH060355@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rodrigc
Date: Mon Nov 16 17:11:11 2015
New Revision: 290940
URL: https://svnweb.freebsd.org/changeset/base/290940

Log:
  Do not use SA_LEN() to dereference sa_len.
  
  FreeBSD lacks the SA_LEN() macro.

Modified:
  head/usr.sbin/ypldap/ldapclient.c

Modified: head/usr.sbin/ypldap/ldapclient.c
==============================================================================
--- head/usr.sbin/ypldap/ldapclient.c	Mon Nov 16 17:08:51 2015	(r290939)
+++ head/usr.sbin/ypldap/ldapclient.c	Mon Nov 16 17:11:11 2015	(r290940)
@@ -71,14 +71,14 @@ client_aldap_open(struct ypldap_addr *ad
 		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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511161711.tAGHBBxH060355>