diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp
index 3ffe6d2d3bee52b4c59f0cf0ca78168442bad7f1..4a7d326c0e6eae90dfe6e7cb3b6fe0358c075f20 100644
--- a/indra/llmessage/llproxy.cpp
+++ b/indra/llmessage/llproxy.cpp
@@ -180,7 +180,6 @@ S32 LLProxy::proxyHandshake(LLHost proxy)
 	mUDPProxy.setAddress(proxy.getAddress());
 	// The connection was successful. We now have the UDP port to send requests that need forwarding to.
 	LL_INFOS("Proxy") << "SOCKS 5 UDP proxy connected on " << mUDPProxy << LL_ENDL;
-	sUDPProxyEnabled = true;
 
 	return SOCKS_OK;
 }
@@ -223,6 +222,11 @@ S32 LLProxy::startSOCKSProxy(LLHost host)
 		// Shut down the proxy if any of the above steps failed.
 		stopSOCKSProxy();
 	}
+	else
+	{
+		// Connection was successful.
+		sUDPProxyEnabled = true;
+	}
 
 	return status;
 }