summaryrefslogtreecommitdiff
path: root/mail/mini_sendmail/patches/patch-aa
blob: 50c59a81fc468549ee0cb979b4e785daca1fb544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$NetBSD: patch-aa,v 1.1 2003/02/15 22:11:28 is Exp $

--- mini_sendmail.c.orig	Thu Nov 21 21:27:55 2002
+++ mini_sendmail.c
@@ -575,14 +575,16 @@
     sock_family = PF_INET6;
 
 #ifdef DO_MINUS_S
-    if ( inet_pton( PF_INET, server, (void*) &sa4.sin_addr ) == 0 )
+
+    (void) memset( (void*) &sa4, 0, sizeof(sa4) );
+    if ( inet_pton( AF_INET, server, (void*) &sa4.sin_addr ) == 1 )
 	{
 	sock_family = PF_INET;
 	sa4.sin_port = htons( SMTP_PORT );
 	sa_len = sizeof(sa4);
 	(void) memmove( &sa, &sa4, sa_len );
 	}
-    else if ( inet_pton( PF_INET6, server, (void*) &sa.sin6_addr ) == -1 )
+    else if ( inet_pton( AF_INET6, server, (void*) &sa.sin6_addr ) != 1 )
 	{
 #ifdef DO_DNS
 	(void) memset( &hints, 0, sizeof(hints) );