Index: /trunk/src/VBox/Devices/Network/DrvIntNet.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 10761)
+++ /trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 10762)
@@ -38,4 +38,7 @@
 #include <iprt/string.h>
 #include <iprt/time.h>
+#ifdef RT_OS_DARWIN
+# include <iprt/ctype.h>
+#endif
 
 #include "Builtins.h"
@@ -237,5 +240,5 @@
         SendReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
         SendReq.Hdr.cbReq = sizeof(SendReq);
-        SendReq.pSession = NULL;
+        SendReq.pSession = NIL_RTR0PTR;
         SendReq.hIf = pThis->hIf;
         pThis->pDrvIns->pDrvHlp->pfnSUPCallVMMR0Ex(pThis->pDrvIns, VMMR0_DO_INTNET_IF_SEND, &SendReq, sizeof(SendReq));
@@ -249,5 +252,5 @@
         SendReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
         SendReq.Hdr.cbReq = sizeof(SendReq);
-        SendReq.pSession = NULL;
+        SendReq.pSession = NIL_RTR0PTR;
         SendReq.hIf = pThis->hIf;
         rc = pThis->pDrvIns->pDrvHlp->pfnSUPCallVMMR0Ex(pThis->pDrvIns, VMMR0_DO_INTNET_IF_SEND, &SendReq, sizeof(SendReq));
@@ -276,5 +279,5 @@
     Req.Hdr.u32Magic    = SUPVMMR0REQHDR_MAGIC;
     Req.Hdr.cbReq       = sizeof(Req);
-    Req.pSession        = NULL;
+    Req.pSession        = NIL_RTR0PTR;
     Req.hIf             = pThis->hIf;
     Req.fPromiscuous    = fPromiscuous;
@@ -431,5 +434,5 @@
         WaitReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
         WaitReq.Hdr.cbReq    = sizeof(WaitReq);
-        WaitReq.pSession     = NULL;
+        WaitReq.pSession     = NIL_RTR0PTR;
         WaitReq.hIf          = pThis->hIf;
         WaitReq.cMillies     = 30000; /* 30s - don't wait forever, timeout now and then. */
@@ -619,5 +622,5 @@
         CloseReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
         CloseReq.Hdr.cbReq = sizeof(CloseReq);
-        CloseReq.pSession = NULL;
+        CloseReq.pSession = NIL_RTR0PTR;
         CloseReq.hIf = pThis->hIf;
         pThis->hIf = INTNET_HANDLE_INVALID;
@@ -709,5 +712,5 @@
     OpenReq.Hdr.cbReq = sizeof(OpenReq);
     OpenReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
-    OpenReq.pSession = NULL;
+    OpenReq.pSession = NIL_RTR0PTR;
 
     /** @cfgm{Network, string}
@@ -755,28 +758,28 @@
     OpenReq.fFlags = fRestrictAccess ? 0 : INTNET_OPEN_FLAGS_PUBLIC;
 
-    /** @cfgm{ReceiveBufferSize, uint32_t, 256 KB}
+    /** @cfgm{ReceiveBufferSize, uint32_t, 234 KB}
      * The size of the receive buffer.
      */
     rc = CFGMR3QueryU32(pCfgHandle, "ReceiveBufferSize", &OpenReq.cbRecv);
     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
-        OpenReq.cbRecv = _256K;
+        OpenReq.cbRecv = 234 * _1K ;
     else if (VBOX_FAILURE(rc))
         return PDMDRV_SET_ERROR(pDrvIns, rc,
                                 N_("Configuration error: Failed to get the \"ReceiveBufferSize\" value"));
 
-    /** @cfgm{SendBufferSize, uint32_t, 4 KB}
+    /** @cfgm{SendBufferSize, uint32_t, 17 KB}
      * The size of the send (transmit) buffer.
      */
     rc = CFGMR3QueryU32(pCfgHandle, "SendBufferSize", &OpenReq.cbSend);
     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
-        OpenReq.cbSend = _4K;
+        OpenReq.cbSend = 17*_1K;
     else if (VBOX_FAILURE(rc))
         return PDMDRV_SET_ERROR(pDrvIns, rc,
                                 N_("Configuration error: Failed to get the \"SendBufferSize\" value"));
-    if (OpenReq.cbSend < 16)
+    if (OpenReq.cbSend < 32)
         return PDMDRV_SET_ERROR(pDrvIns, rc,
                                 N_("Configuration error: The \"SendBufferSize\" value is too small"));
-    if (OpenReq.cbSend < 1536*2 + 4)
-        LogRel(("DrvIntNet: Warning! SendBufferSize=%u, Recommended minimum size %u butes.\n", OpenReq.cbSend, 1536*2 + 4));
+    if (OpenReq.cbSend < 1536*2 + 64)
+        LogRel(("DrvIntNet: Warning! SendBufferSize=%u, Recommended minimum size %u butes.\n", OpenReq.cbSend, 1536*2 + 64));
 
     /** @cfgm{IsService, boolean, true}
@@ -794,4 +797,17 @@
             pDrvIns->iInstance, OpenReq.szNetwork, OpenReq.enmTrunkType, OpenReq.szTrunk, OpenReq.fFlags,
             OpenReq.cbRecv, OpenReq.cbSend));
+
+#ifdef RT_OS_DARWIN
+    /* Temporary hack: attach to a network with the name 'if=en0' and you're hitting the wire. */
+    if (    !OpenReq.szTrunk[0]
+        &&   OpenReq.enmTrunkType == kIntNetTrunkType_None
+        &&  !strncmp(pThis->szNetwork, "if=en", sizeof("if=en") - 1)
+        &&  RT_C_IS_DIGIT(pThis->szNetwork[sizeof("if=en") - 1])
+        &&  !pThis->szNetwork[sizeof("if=en")])
+    {
+        OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt;
+        strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("if=") - 1]);
+    }
+#endif
 
     /*
@@ -820,5 +836,5 @@
     GetRing3BufferReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
     GetRing3BufferReq.Hdr.cbReq = sizeof(GetRing3BufferReq);
-    GetRing3BufferReq.pSession = NULL;
+    GetRing3BufferReq.pSession = NIL_RTR0PTR;
     GetRing3BufferReq.hIf = pThis->hIf;
     GetRing3BufferReq.pRing3Buf = NULL;
