summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src/sasl.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/src/sasl.c')
-rw-r--r--contrib/sendmail/src/sasl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/sendmail/src/sasl.c b/contrib/sendmail/src/sasl.c
index e2bf415..9e368ff 100644
--- a/contrib/sendmail/src/sasl.c
+++ b/contrib/sendmail/src/sasl.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: sasl.c,v 8.20 2004/06/02 22:48:06 ca Exp $")
+SM_RCSID("@(#)$Id: sasl.c,v 8.21 2004/11/22 23:09:00 gshapiro Exp $")
#if SASL
# include <stdlib.h>
@@ -226,9 +226,6 @@ intersect(s1, s2, rpool)
# include <arpa/inet.h>
-# ifndef NI_WITHSCOPEID
-# define NI_WITHSCOPEID 0
-# endif
# ifndef NI_MAXHOST
# define NI_MAXHOST 1025
# endif
@@ -244,6 +241,9 @@ iptostring(addr, addrlen, out, outlen)
unsigned outlen;
{
char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
+# if NETINET6
+ int niflags;
+# endif /* NETINET6 */
if (addr == NULL || out == NULL)
{
@@ -252,9 +252,13 @@ iptostring(addr, addrlen, out, outlen)
}
# if NETINET6
+ niflags = (NI_NUMERICHOST | NI_NUMERICSERV);
+# ifdef NI_WITHSCOPEID
+ if (addr->sa.sa_family == AF_INET6)
+ niflags |= NI_WITHSCOPEID;
+# endif /* NI_WITHSCOPEID */
if (getnameinfo((struct sockaddr *) addr, addrlen,
- hbuf, sizeof hbuf, pbuf, sizeof pbuf,
- NI_NUMERICHOST | NI_WITHSCOPEID | NI_NUMERICSERV) != 0)
+ hbuf, sizeof hbuf, pbuf, sizeof pbuf, niflags) != 0)
return false;
# else /* NETINET6 */
if (addr->sa.sa_family != AF_INET)
OpenPOWER on IntegriCloud