VirtualBox

Ignore:
Timestamp:
Oct 14, 2015 5:15:56 PM (9 years ago)
Author:
vboxsync
Message:

VBoxNetAdp/linux, VBoxNetFlt/linux: treat presence of VBoxNetFlt as
the "carrier" for VBoxNetAdp (as we already do for tap), so that
host-only interface is IF_OPER_UP only when the filter is attached.
Adjust link-state check in VBoxNetFlt to call netif_carrier_on() for
host-only interfaces too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c

    r58222 r58254  
    262262
    263263            /*
    264              * To get proper operstate transition to IF_OPER_UP we
    265              * need to call netif_carrier_on(), which triggers netlink
    266              * notifications that do the work.  But first we need to
    267              * turn it off here, otherwise that call will do nothing
    268              * and we will be stuck in IF_OPER_UNKNOWN.
     264             * We treat presence of VBoxNetFlt filter as our "carrier",
     265             * see vboxNetFltSetLinkState().
    269266             *
    270              * Do this before registration so that only the state bit
    271              * is set, but no state change notifications are generated.
     267             * operstates.txt: "On device allocation, networking core
     268             * sets the flags equivalent to netif_carrier_ok() and
     269             * !netif_dormant()" - so turn carrier off here.
    272270             */
    273271            netif_carrier_off(pNetDev);
     
    279277                pThis->szName[sizeof(pThis->szName) - 1] = '\0';
    280278                pThis->u.s.pNetDev = pNetDev;
    281 
    282                 /*
    283                  * TODO: We might want to set carrier only when
    284                  * VBoxNetFlt attaches the intnet to us.
    285                  */
    286                 netif_carrier_on(pNetDev);
    287 
    288279                Log2(("vboxNetAdpOsCreate: pThis=%p pThis->szName = %p\n", pThis, pThis->szName));
    289280                return VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette