]> granicus.if.org Git - mutt/commitdiff
Make it possible to enable ipv6 at run time.
authorThomas Roessler <roessler@does-not-exist.org>
Sun, 4 Mar 2001 10:57:50 +0000 (10:57 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sun, 4 Mar 2001 10:57:50 +0000 (10:57 +0000)
init.h
mutt.h
mutt_socket.c

diff --git a/init.h b/init.h
index 73b69b13c0ade84475002f7080e9c472dc9d1215..efc9233307ceacb8c80c73524ba5cc7085743b2a 100644 (file)
--- 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 620c26e658f0cf1722f4b7624bbb05aba3f3c7ef..1d3065bff7c1117c606d283357f982f7943b4daf 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -382,6 +382,9 @@ enum
   OPTUSE8BITMIME,
   OPTUSEDOMAIN,
   OPTUSEFROM,
+#ifdef HAVE_GETADDRINFO
+  OPTUSEIPV6,
+#endif
   OPTWAITKEY,
   OPTWEED,
   OPTWRAP,
index d653b9d5219dffb0b7c165b9a6154421d21bf143..4a9508202de360dc781fb6372edd938240e4b6d4 100644 (file)
@@ -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);