Index: /trunk/include/iprt/udp.h
===================================================================
--- /trunk/include/iprt/udp.h	(revision 57969)
+++ /trunk/include/iprt/udp.h	(revision 57970)
@@ -156,9 +156,9 @@
  * @param   pszAddress          The address to connect to.
  * @param   uPort               The port to connect to.
- * @param   pDefaultDstAddr     A default destination address for sending data
- *                              through this socket, can be NULL.
+ * @param   pLocalAddr          The local address to bind this socket to, can be
+ *                              NULL.
  * @param   pSock               Where to store the handle to the established connection.
  */
-RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR pDefaultDstAddr, PRTSOCKET pSock);
+RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR pLocalAddr, PRTSOCKET pSock);
 
 /** @} */
Index: /trunk/src/VBox/Runtime/r3/udp.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/udp.cpp	(revision 57969)
+++ /trunk/src/VBox/Runtime/r3/udp.cpp	(revision 57970)
@@ -688,5 +688,5 @@
 
 
-RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR pDefaultDstAddr, PRTSOCKET pSock)
+RTR3DECL(int) RTUdpCreateClientSocket(const char *pszAddress, uint32_t uPort, PRTNETADDR pLocalAddr, PRTSOCKET pSock)
 {
     /*
@@ -695,4 +695,5 @@
     AssertReturn(uPort > 0, VERR_INVALID_PARAMETER);
     AssertPtrReturn(pszAddress, VERR_INVALID_POINTER);
+    AssertPtrReturn(pSock, VERR_INVALID_POINTER);
 
     /*
@@ -712,9 +713,9 @@
     {
         RTSocketSetInheritance(Sock, false /* fInheritable */);
-        rc = rtSocketBind(Sock, &Addr);
+        if (pLocalAddr)
+            rc = rtSocketBind(Sock, pLocalAddr);
         if (RT_SUCCESS(rc))
         {
-            if (pDefaultDstAddr)
-                rc = rtSocketConnect(Sock, pDefaultDstAddr, RT_SOCKETCONNECT_DEFAULT_WAIT);
+            rc = rtSocketConnect(Sock, &Addr, RT_SOCKETCONNECT_DEFAULT_WAIT);
             if (RT_SUCCESS(rc))
             {
Index: /trunk/src/VBox/Runtime/testcase/tstRTUdp-1.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstRTUdp-1.cpp	(revision 57969)
+++ /trunk/src/VBox/Runtime/testcase/tstRTUdp-1.cpp	(revision 57970)
@@ -30,7 +30,4 @@
 #include <iprt/string.h>
 #include <iprt/test.h>
-
-#define RT_TEST_UDP_CLIENT_ADDRESS     "localhost"
-#define RT_TEST_UDP_CLIENT_PORT        52001
 
 /* Server address must be "localhost" */
@@ -99,6 +96,5 @@
     int rc;
     RTSOCKET hSocket;
-    RTTESTI_CHECK_RC(rc = RTUdpCreateClientSocket(RT_TEST_UDP_CLIENT_ADDRESS, RT_TEST_UDP_CLIENT_PORT, &ServerAddress, &hSocket),
-                     VINF_SUCCESS);
+    RTTESTI_CHECK_RC(rc = RTUdpCreateClientSocket(RT_TEST_UDP_LOCAL_HOST, RT_TEST_UDP_SERVER_PORT, NULL, &hSocket), VINF_SUCCESS);
     if (RT_SUCCESS(rc))
     {
