pkgsrc/mail/mini_sendmail/patches/patch-aa

34 lines
1.1 KiB
Text

$NetBSD: patch-aa,v 1.4 2003/10/07 08:45:14 is Exp $
--- mini_sendmail.c.orig Thu Nov 21 21:27:55 2002
+++ mini_sendmail.c
@@ -129,6 +129,10 @@ main( int argc, char** argv )
timeout = atoi( &(argv[argn][2]) );
else if ( strcmp( argv[argn], "-v" ) == 0 )
verbose = 1;
+ else if ( strcmp( argv[argn], "-oeq" ) == 0 )
+ verbose = 0;
+ else if ( strcmp( argv[argn], "-i" ) == 0 || strcmp ( argv[argn], "-oi" ) == 0 )
+ /* do nothing */ ;
else
usage();
++argn;
@@ -575,14 +579,16 @@ open_client_socket( void )
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) );