Merge branch 'patch-1' of https://github.com/bes-internal/exim into master-bes-rateli...
[users/jgh/exim.git] / src / src / ip.c
index 11f0fd88b17240881eeae0eaee36dd1f8e8ac9bb..98eed1b934777be9e1d29a527df9eb7500acda28 100644 (file)
@@ -347,8 +347,10 @@ for (;;)
 close down of the connection), set errno to zero; otherwise leave it alone. */
 
 #ifdef SUPPORT_TLS
-if (tls_active == sock)
-  rc = tls_read(buffer, buffsize);
+if (tls_out.active == sock)
+  rc = tls_read(FALSE, buffer, buffsize);
+else if (tls_in.active == sock)
+  rc = tls_read(TRUE, buffer, buffsize);
 else
 #endif
   rc = recv(sock, buffer, buffsize, 0);
@@ -462,11 +464,13 @@ if (af == AF_INET)
   *level = IPPROTO_IP;
   *optname = IP_TOS;
   }
+#if HAVE_IPV6
 else if (af == AF_INET6)
   {
   *level = IPPROTO_IPV6;
   *optname = IPV6_TCLASS;
   }
+#endif
 else
   {
   DEBUG(D_transport)