From 8eb39923ceec15570d3e709103f118115f44a2fd Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 25 Sep 2003 15:16:51 +0000 Subject: If the localhost lookup results in a numeric IPv6 host, use the form 2003-09-25 Jeffrey Stedfast * providers/smtp/camel-smtp-transport.c (smtp_helo): If the localhost lookup results in a numeric IPv6 host, use the form "[IPv6:]" as specified in rfc2821. Fixes bug #46006. svn path=/trunk/; revision=22694 --- camel/providers/smtp/camel-smtp-transport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'camel/providers') diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index e2e1fccf5c..120b24d1dc 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -895,8 +895,10 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex) } else { #ifdef ENABLE_IPv6 char ip[MAXHOSTNAMELEN + 1]; + const char *proto; - name = g_strdup_printf ("[%s]", inet_ntop (af, transport->localaddr->address, ip, MAXHOSTNAMELEN)); + proto = transport->localaddr->family == CAMEL_TCP_ADDRESS_IPv6 ? "IPv6:" : ""; + name = g_strdup_printf ("[%s%s]", proto, inet_ntop (af, transport->localaddr->address, ip, MAXHOSTNAMELEN)); #else /* We *could* use inet_ntoa() here, but it's probably not worth it since we would have to worry about -- cgit v1.2.3