Index: /trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c	(revision 58253)
+++ /trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c	(revision 58254)
@@ -262,12 +262,10 @@
 
             /*
-             * To get proper operstate transition to IF_OPER_UP we
-             * need to call netif_carrier_on(), which triggers netlink
-             * notifications that do the work.  But first we need to
-             * turn it off here, otherwise that call will do nothing
-             * and we will be stuck in IF_OPER_UNKNOWN.
+             * We treat presence of VBoxNetFlt filter as our "carrier",
+             * see vboxNetFltSetLinkState().
              *
-             * Do this before registration so that only the state bit
-             * is set, but no state change notifications are generated.
+             * operstates.txt: "On device allocation, networking core
+             * sets the flags equivalent to netif_carrier_ok() and
+             * !netif_dormant()" - so turn carrier off here.
              */
             netif_carrier_off(pNetDev);
@@ -279,11 +277,4 @@
                 pThis->szName[sizeof(pThis->szName) - 1] = '\0';
                 pThis->u.s.pNetDev = pNetDev;
-
-                /*
-                 * TODO: We might want to set carrier only when
-                 * VBoxNetFlt attaches the intnet to us.
-                 */
-                netif_carrier_on(pNetDev);
-
                 Log2(("vboxNetAdpOsCreate: pThis=%p pThis->szName = %p\n", pThis, pThis->szName));
                 return VINF_SUCCESS;
Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c	(revision 58253)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c	(revision 58254)
@@ -1554,9 +1554,9 @@
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
-/**
- * Helper for detecting TAP devices.
- */
-static bool vboxNetFltIsTapDevice(PVBOXNETFLTINS pThis, struct net_device *pDev)
+/**
+ * Does this device needs link state change signaled?
+ * Currently we need it for our own VBoxNetAdp and TAP.
+ */
+static bool vboxNetFltNeedsLinkState(PVBOXNETFLTINS pThis, struct net_device *pDev)
 {
     if (pDev->ethtool_ops && pDev->ethtool_ops->get_drvinfo)
@@ -1567,9 +1567,17 @@
         Info.cmd = ETHTOOL_GDRVINFO;
         pDev->ethtool_ops->get_drvinfo(pDev, &Info);
-        Log3(("vboxNetFltIsTapDevice: driver=%s version=%s bus_info=%s\n",
-              Info.driver, Info.version, Info.bus_info));
-
+        Log3(("%s: driver=%.*s version=%.*s bus_info=%.*s\n",
+              __FUNCTION__,
+              sizeof(Info.driver),   Info.driver,
+              sizeof(Info.version),  Info.version,
+              sizeof(Info.bus_info), Info.bus_info));
+
+        if (!strncmp(Info.driver, "vboxnet", sizeof(Info.driver)))
+            return true;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) /* TAP started doing carrier */
         return !strncmp(Info.driver,   "tun", 4)
             && !strncmp(Info.bus_info, "tap", 4);
+#endif
     }
 
@@ -1578,13 +1586,13 @@
 
 /**
- * Helper for updating the link state of TAP devices.
- * Only TAP devices are affected.
- */
-static void vboxNetFltSetTapLinkState(PVBOXNETFLTINS pThis, struct net_device *pDev, bool fLinkUp)
-{
-    if (vboxNetFltIsTapDevice(pThis, pDev))
-    {
-        Log3(("vboxNetFltSetTapLinkState: bringing %s tap device link state\n",
-              fLinkUp ? "up" : "down"));
+ * Some devices need link state change when filter attaches/detaches
+ * since the filter is their link in a sense.
+ */
+static void vboxNetFltSetLinkState(PVBOXNETFLTINS pThis, struct net_device *pDev, bool fLinkUp)
+{
+    if (vboxNetFltNeedsLinkState(pThis, pDev))
+    {
+        Log3(("%s: bringing device link %s\n",
+              __FUNCTION__, fLinkUp ? "up" : "down"));
         netif_tx_lock_bh(pDev);
         if (fLinkUp)
@@ -1595,10 +1603,4 @@
     }
 }
-#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) */
-DECLINLINE(void) vboxNetFltSetTapLinkState(PVBOXNETFLTINS pThis, struct net_device *pDev, bool fLinkUp)
-{
-    /* Nothing to do for pre-2.6.36 kernels. */
-}
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) */
 
 /**
@@ -1654,8 +1656,7 @@
 
     /*
-     * If attaching to TAP interface we need to bring the link state up
-     * starting from 2.6.36 kernel.
-     */
-    vboxNetFltSetTapLinkState(pThis, pDev, true);
+     * Are we the "carrier" for this device (e.g. vboxnet or tap)?
+     */
+    vboxNetFltSetLinkState(pThis, pDev, true);
 
     /*
@@ -2261,5 +2262,5 @@
     if (fRegistered)
     {
-        vboxNetFltSetTapLinkState(pThis, pDev, false);
+        vboxNetFltSetLinkState(pThis, pDev, false);
 
 #ifndef VBOXNETFLT_LINUX_NO_XMIT_QUEUE
