Index: /trunk/include/VBox/intnet.h
===================================================================
--- /trunk/include/VBox/intnet.h	(revision 37978)
+++ /trunk/include/VBox/intnet.h	(revision 37979)
@@ -906,7 +906,13 @@
 #define INTNET_OPEN_FLAGS_TRUNK_WIRE_PROMISC_MODE               RT_BIT_32(26)
 
+/** Used to enable host specific workarounds.
+ *
+ * On darwin this will clear ip_tos in DHCP packets when
+ * INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE is also set. */
+#define INTNET_OPEN_FLAGS_WORKAROUND_1                          RT_BIT_32(31)
+
 
 /** The mask of valid flags. */
-#define INTNET_OPEN_FLAGS_MASK                                  UINT32_C(0x03ffffff)
+#define INTNET_OPEN_FLAGS_MASK                                  UINT32_C(0x83ffffff)
 /** The mask of all flags use to fix (lock) settings. */
 #define INTNET_OPEN_FLAGS_FIXED_MASK \
Index: /trunk/src/VBox/Devices/Network/DrvIntNet.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 37978)
+++ /trunk/src/VBox/Devices/Network/DrvIntNet.cpp	(revision 37979)
@@ -42,4 +42,7 @@
 #include <iprt/thread.h>
 #include <iprt/uuid.h>
+#if defined(RT_OS_DARWIN) && defined(IN_RING3)
+# include <iprt/system.h>
+#endif
 
 #include "VBoxDD.h"
@@ -1358,5 +1361,6 @@
                                   "|TrunkPolicyWire"
                                   "|IsService"
-                                  "|IgnoreConnectFailure",
+                                  "|IgnoreConnectFailure"
+                                  "|Workaround1",
                                   "");
 
@@ -1600,4 +1604,28 @@
         return PDMDRV_SET_ERROR(pDrvIns, rc,
                                 N_("Configuration error: Failed to get the \"IgnoreConnectFailure\" value"));
+
+    /** @cfgm{Workaround1, boolean, depends}
+     * Enables host specific workarounds, the default is depends on the whether
+     * we think the host requires it or not.
+     */
+    bool fWorkaround1 = false;
+#ifdef RT_OS_DARWIN
+    if (OpenReq.fFlags & INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE)
+    {
+        char szKrnlVer[256];
+        RTSystemQueryOSInfo(RTSYSOSINFO_RELEASE, szKrnlVer, sizeof(szKrnlVer));
+        if (strcmp(szKrnlVer, "10.7.0") >= 0)
+        {
+            LogRel(("IntNet#%u: Enables the workaround (ip_tos=0) for the little endian ip header checksum problem\n"));
+            fWorkaround1 = true;
+        }
+    }
+#endif
+    rc = CFGMR3QueryBoolDef(pCfg, "Workaround1", &fWorkaround1, fWorkaround1);
+    if (RT_FAILURE(rc))
+        return PDMDRV_SET_ERROR(pDrvIns, rc,
+                                N_("Configuration error: Failed to get the \"Workaround1\" value"));
+    if (fWorkaround1)
+        OpenReq.fFlags |= INTNET_OPEN_FLAGS_WORKAROUND_1;
 
     LogRel(("IntNet#%u: szNetwork={%s} enmTrunkType=%d szTrunk={%s} fFlags=%#x cbRecv=%u cbSend=%u fIgnoreConnectFailure=%RTbool\n",
Index: /trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp	(revision 37978)
+++ /trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp	(revision 37979)
@@ -2949,6 +2949,6 @@
     }
     PCRTNETBOOTP pDhcp = (PCRTNETBOOTP)(pUdpHdr + 1);
-    uint8_t MsgType;
-    if (!RTNetIPv4IsDHCPValid(pUdpHdr, pDhcp, cbUdpPkt - sizeof(*pUdpHdr), &MsgType))
+    uint8_t bMsgType;
+    if (!RTNetIPv4IsDHCPValid(pUdpHdr, pDhcp, cbUdpPkt - sizeof(*pUdpHdr), &bMsgType))
     {
         Log6(("intnetR0NetworkEditDhcpFromIntNet: Bad DHCP packet\n"));
@@ -2956,14 +2956,20 @@
     }
 
-    switch (MsgType)
+    switch (bMsgType)
     {
         case RTNET_DHCP_MT_DISCOVER:
         case RTNET_DHCP_MT_REQUEST:
-            Log6(("intnetR0NetworkEditDhcpFromIntNet: Setting broadcast flag in DHCP %#x, previously %x\n", MsgType, pDhcp->bp_flags));
+            /*
+             * Must set the broadcast flag or we won't catch the respons.
+             */
             if (!(pDhcp->bp_flags & RT_H2BE_U16_C(RTNET_DHCP_FLAG_BROADCAST)))
             {
+                Log6(("intnetR0NetworkEditDhcpFromIntNet: Setting broadcast flag in DHCP %#x, previously %x\n",
+                      bMsgType, pDhcp->bp_flags));
+
                 /* Patch flags */
                 uint16_t uFlags = pDhcp->bp_flags | RT_H2BE_U16_C(RTNET_DHCP_FLAG_BROADCAST);
                 intnetR0SgWritePart(pSG, (uintptr_t)&pDhcp->bp_flags - (uintptr_t)pIpHdr + sizeof(RTNETETHERHDR), sizeof(uFlags), &uFlags);
+
                 /* Patch UDP checksum */
                 uint32_t uChecksum = (uint32_t)~pUdpHdr->uh_sum + RT_H2BE_U16_C(RTNET_DHCP_FLAG_BROADCAST);
@@ -2973,4 +2979,29 @@
                 intnetR0SgWritePart(pSG, (uintptr_t)&pUdpHdr->uh_sum - (uintptr_t)pIpHdr + sizeof(RTNETETHERHDR), sizeof(pUdpHdr->uh_sum), &uChecksum);
             }
+
+#ifdef RT_OS_DARWIN
+            /*
+             * Work around little endian checksum issue in mac os x 10.7.0 GM.
+             */
+            if (   pIpHdr->ip_tos
+                && (pNetwork->fFlags & INTNET_OPEN_FLAGS_WORKAROUND_1))
+            {
+                /* Patch it. */
+                uint8_t uTos  = pIpHdr->ip_tos;
+                uint8_t uZero = 0;
+                intnetR0SgWritePart(pSG, sizeof(RTNETETHERHDR) + 1, sizeof(uZero), &uZero);
+
+                /* Patch the IP header checksum. */
+                uint32_t uChecksum = (uint32_t)~pIpHdr->ip_sum - (uTos << 8);
+                while (uChecksum >> 16)
+                    uChecksum = (uChecksum >> 16) + (uChecksum & 0xFFFF);
+                uChecksum = ~uChecksum;
+
+                Log(("intnetR0NetworkEditDhcpFromIntNet: cleared ip_tos (was %#04x); ip_sum=%#06x -> %#06x\n",
+                     uTos, RT_BE2H_U16(pIpHdr->ip_sum), RT_BE2H_U16(uChecksum) ));
+                intnetR0SgWritePart(pSG, sizeof(RTNETETHERHDR) + RT_OFFSETOF(RTNETIPV4, ip_sum),
+                                    sizeof(pIpHdr->ip_sum), &uChecksum);
+            }
+#endif
             break;
     }
