This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Mailutils".
http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=4066c947d378bba39bdc36d8f1c7b0c4c4070ebd The branch, master has been updated via 4066c947d378bba39bdc36d8f1c7b0c4c4070ebd (commit) from 177423b53793e3ad5dc6fd787f75b3ff4038aedf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4066c947d378bba39bdc36d8f1c7b0c4c4070ebd Author: Sergey Poznyakoff <g...@gnu.org.ua> Date: Fri Apr 13 18:17:06 2012 +0300 Fix SMTP test on machines with IPv6 enabled. * testsuite/smtpsend.c: New assignment option `family=' to force using a specified interface family. * testsuite/smtp-msg.at: Force IPv4. * testsuite/smtp-str.at: Likewise. ----------------------------------------------------------------------- Summary of changes: testsuite/smtp-msg.at | 2 +- testsuite/smtp-str.at | 2 +- testsuite/smtpsend.c | 29 +++++++++++++++++++++++------ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/testsuite/smtp-msg.at b/testsuite/smtp-msg.at index 6ffae20..4214071 100644 --- a/testsuite/smtp-msg.at +++ b/testsuite/smtp-msg.at @@ -34,7 +34,7 @@ p=`$abs_top_builddir/examples/mta -bd` test $? -eq 0 || AT_SKIP_TEST set -- $p # $1 - pid, $2 - port -smtpsend localhost port=$2 \ +smtpsend localhost port=$2 family=4\ from=mailut...@mailutils.org\ rcpt=g...@example.org\ domain=mailutils.org\ diff --git a/testsuite/smtp-str.at b/testsuite/smtp-str.at index bee5cc3..b56f93e 100644 --- a/testsuite/smtp-str.at +++ b/testsuite/smtp-str.at @@ -34,7 +34,7 @@ p=`$abs_top_builddir/examples/mta -bd` test $? -eq 0 || AT_SKIP_TEST set -- $p # $1 - pid, $2 - port -smtpsend localhost port=$2 \ +smtpsend localhost port=$2 family=4\ from=mailut...@mailutils.org\ rcpt=g...@example.org\ domain=mailutils.org\ diff --git a/testsuite/smtpsend.c b/testsuite/smtpsend.c index 40361e2..993c52b 100644 --- a/testsuite/smtpsend.c +++ b/testsuite/smtpsend.c @@ -28,7 +28,7 @@ static char usage_text[] = "usage: %s hostname [port=N] [trace=N] [tls=N] [from=STRING] [rcpt=STRING]\n" -" [domain=STRING] [user=STRING] [pass=STRING]\n" +" [family=4|6] [domain=STRING] [user=STRING] [pass=STRING]\n" " [service=STRING] [realm=STRING] [host=STRING]\n" " [auth=method[,...]] [url=STRING] [input=FILE] [raw=N]\n" " [skiphdr=name[,...]]\n"; @@ -107,12 +107,34 @@ main (int argc, char **argv) if (argc < 2) usage (); + memset (&hints, 0, sizeof (hints)); + hints.flags = MU_AH_DETECT_FAMILY; + hints.port = 25; + hints.protocol = IPPROTO_TCP; + hints.socktype = SOCK_STREAM; + MU_ASSERT (mu_smtp_create (&smtp)); for (i = 1; i < argc; i++) { if (strncmp (argv[i], "port=", 5) == 0) port = argv[i] + 5; + else if (strncmp (argv[i], "family=", 7) == 0) + { + hints.flags &= ~MU_AH_DETECT_FAMILY; + switch (argv[i][7]) + { + case '4': + hints.family = AF_INET; + break; + case '6': + hints.family = AF_INET6; + break; + default: + mu_error ("invalid family name: %s", argv[i]+7); + exit (1); + } + } else if (strncmp (argv[i], "trace=", 6) == 0) { char *arg = argv[i] + 6; @@ -195,11 +217,6 @@ main (int argc, char **argv) host = argv[1]; - memset (&hints, 0, sizeof (hints)); - hints.flags = MU_AH_DETECT_FAMILY; - hints.port = 25; - hints.protocol = IPPROTO_TCP; - hints.socktype = SOCK_STREAM; MU_ASSERT (mu_sockaddr_from_node (&sa, host, port, &hints)); MU_ASSERT (mu_tcp_stream_create_from_sa (&stream, sa, NULL, MU_STREAM_RDWR)); hooks/post-receive -- GNU Mailutils _______________________________________________ Commit-mailutils mailing list Commit-mailutils@gnu.org https://lists.gnu.org/mailman/listinfo/commit-mailutils