$OpenBSD: patch-mini_sendmail_c,v 1.2 2003/11/05 04:51:08 jolan Exp $ --- mini_sendmail.c.orig 2003-09-29 11:17:25.000000000 -0500 +++ mini_sendmail.c 2003-11-04 22:32:55.000000000 -0600 @@ -43,6 +43,7 @@ #include #include #include +#include #include #ifdef DO_RECEIVED @@ -131,6 +132,8 @@ main( int argc, char** argv ) verbose = 1; else if ( strcmp( argv[argn], "--" ) == 0 ) ; /* ignore */ + else if ( strcmp( argv[argn], "-i" ) == 0 || strcmp ( argv[argn], "-oi" ) == 0 ) + ; /* ignore */ else usage(); ++argn; @@ -577,14 +580,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) );