From 2ff1db7b4ef1f96adc6af2a669bccf3b49435a88 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Sun, 4 Mar 2001 10:57:50 +0000 Subject: [PATCH] Make it possible to enable ipv6 at run time. --- init.h | 7 +++++++ mutt.h | 3 +++ mutt_socket.c | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/init.h b/init.h index 73b69b13..efc92333 100644 --- a/init.h +++ b/init.h @@ -2146,6 +2146,13 @@ struct option_t MuttVars[] = { ** generated unless the user explicitly sets one using the ``$my_hdr'' ** command. */ + { "use_ipv6", DT_BOOL, R_NONE, OPTUSEIPV6, 1}, + /* + ** .pp + ** When \fIset\fP, Mutt will look for IPv6 addresses of hosts it tries to + ** contact. If this option is unset, Mutt will restrict itself to IPv4 addresses. + ** Normally, the default should work. + */ { "user_agent", DT_BOOL, R_NONE, OPTXMAILER, 1}, /* ** .pp diff --git a/mutt.h b/mutt.h index 620c26e6..1d3065bf 100644 --- a/mutt.h +++ b/mutt.h @@ -382,6 +382,9 @@ enum OPTUSE8BITMIME, OPTUSEDOMAIN, OPTUSEFROM, +#ifdef HAVE_GETADDRINFO + OPTUSEIPV6, +#endif OPTWAITKEY, OPTWEED, OPTWRAP, diff --git a/mutt_socket.c b/mutt_socket.c index d653b9d5..4a950820 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -318,7 +318,12 @@ int raw_socket_open (CONNECTION* conn) /* we accept v4 or v6 STREAM sockets */ memset (&hints, 0, sizeof (hints)); - hints.ai_family = AF_UNSPEC; + + if (option (OPTUSEIPV6)) + hints.ai_family = AF_UNSPEC; + else + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; snprintf (port, sizeof (port), "%d", conn->account.port); -- 2.40.0