VirtualBox

Ticket #5747: VBox_fSharedMacOnWire-6.2.26.patch

File VBox_fSharedMacOnWire-6.2.26.patch, 6.8 KB (added by guanx, 3 years ago)

Force SharedMacOnWire for bonding interface -- for VirtualBox-6.2.26

  • src/VBox/Frontends/VBoxManage/VBoxManageList.cpp

    diff -pru VirtualBox-6.1.26.orig/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp VirtualBox-6.1.26/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
    old new static HRESULT listNetworkInterfaces(con  
    182182        BOOL fWireless = FALSE;
    183183        networkInterface->COMGETTER(Wireless)(&fWireless);
    184184        RTPrintf("Wireless:        %s\n", fWireless ? "Yes" : "No");
     185        BOOL fMaster = FALSE;
     186        networkInterface->COMGETTER(Master)(&fMaster);
     187        RTPrintf("Master:          %s\n", fMaster ? "Yes" : "No");
    185188        HostNetworkInterfaceStatus_T Status;
    186189        networkInterface->COMGETTER(Status)(&Status);
    187190        RTPrintf("Status:          %s\n", getHostIfStatusText(Status));
  • src/VBox/Main/idl/VirtualBox.xidl

    diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/idl/VirtualBox.xidl VirtualBox-6.1.26/src/VBox/Main/idl/VirtualBox.xidl
    old new  
    1014510145      <desc>Specifies whether the interface is wireless.</desc>
    1014610146    </attribute>
    1014710147
     10148    <attribute name="master" type="boolean" readonly="yes">
     10149      <desc>Specifies whether the interface is a master device.</desc>
     10150    </attribute>
     10151
    1014810152    <method name="enableStaticIPConfig">
    1014910153      <desc>sets and enables the static IP V4 configuration for the given interface.</desc>
    1015010154      <param name="IPAddress" type="wstring" dir="in">
  • src/VBox/Main/include/HostNetworkInterfaceImpl.h

    diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/include/HostNetworkInterfaceImpl.h VirtualBox-6.1.26/src/VBox/Main/include/HostNetworkInterfaceImpl.h
    old new private:  
    7676    HRESULT getInterfaceType(HostNetworkInterfaceType_T *aType);
    7777    HRESULT getNetworkName(com::Utf8Str &aNetworkName);
    7878    HRESULT getWireless(BOOL *aWireless);
     79    HRESULT getMaster(BOOL *aMaster);
    7980
    8081    // Wrapped IHostNetworkInterface methods
    8182    HRESULT enableStaticIPConfig(const com::Utf8Str &aIPAddress,
    private:  
    125126        HostNetworkInterfaceStatus_T status;
    126127        ULONG speedMbits;
    127128        BOOL wireless;
     129        BOOL master;
    128130    } m;
    129131
    130132};
  • src/VBox/Main/include/netif.h

    diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/include/netif.h VirtualBox-6.1.26/src/VBox/Main/include/netif.h
    old new typedef struct NETIFINFO  
    7777    BOOL           fDhcpEnabled;
    7878    BOOL           fIsDefault;
    7979    BOOL           fWireless;
     80    BOOL           fMaster;
    8081    RTMAC          MACAddress;
    8182    NETIFTYPE      enmMediumType;
    8283    NETIFSTATUS    enmStatus;
  • src/VBox/Main/src-client/ConsoleImpl2.cpp

    diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/src-client/ConsoleImpl2.cpp VirtualBox-6.1.26/src/VBox/Main/src-client/ConsoleImpl2.cpp
    old new int Console::i_configNetwork(const char  
    55965596                trunkName = Bstr(pszTrunk);
    55975597                trunkType = Bstr(TRUNKTYPE_NETFLT);
    55985598
    5599                 BOOL fSharedMacOnWire = false;
    5600                 hrc = hostInterface->COMGETTER(Wireless)(&fSharedMacOnWire);
     5599                BOOL fSharedMacOnWire;
     5600                BOOL fWireless;
     5601                BOOL fMaster;
     5602                hrc = hostInterface->COMGETTER(Wireless)(&fWireless);
    56015603                if (FAILED(hrc))
    56025604                {
     5605                    fWireless = false;
    56035606                    LogRel(("NetworkAttachmentType_Bridged: COMGETTER(Wireless) failed, hrc (0x%x)\n", hrc));
    56045607                    H();
    56055608                }
    5606                 else if (fSharedMacOnWire)
     5609                hrc = hostInterface->COMGETTER(Master)(&fMaster);
     5610                if (FAILED(hrc))
     5611                {
     5612                    fMaster = false;
     5613                    LogRel(("NetworkAttachmentType_Bridged: COMGETTER(Master) failed, hrc (0x%x)\n", hrc));
     5614                    H();
     5615                }
     5616                /* A wireless interface may be an active slave of a master interface */
     5617                fSharedMacOnWire = fMaster || fWireless;
     5618                if (fSharedMacOnWire)
    56075619                {
    56085620                    InsertConfigInteger(pCfg, "SharedMacOnWire", true);
    56095621                    Log(("Set SharedMacOnWire\n"));
  • src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp

    diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp VirtualBox-6.1.26/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp
    old new HRESULT HostNetworkInterface::updateConf  
    265265        m.status = (HostNetworkInterfaceStatus_T)info.enmStatus;
    266266        m.speedMbits = info.uSpeedMbits;
    267267        m.wireless = info.fWireless;
     268        m.master = info.fMaster;
    268269        return S_OK;
    269270    }
    270271    return rc == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL;
    HRESULT HostNetworkInterface::init(Utf8S  
    326327    m.status = (HostNetworkInterfaceStatus_T)pIf->enmStatus;
    327328    m.speedMbits = pIf->uSpeedMbits;
    328329    m.wireless = pIf->fWireless;
     330    m.master = pIf->fMaster;
    329331
    330332    /* Confirm a successful initialization */
    331333    autoInitSpan.setSucceeded();
    HRESULT HostNetworkInterface::getWireles  
    535537
    536538    return S_OK;
    537539}
     540
     541HRESULT HostNetworkInterface::getMaster(BOOL *aMaster)
     542{
     543    *aMaster = m.master;
     544
     545    return S_OK;
     546}
    538547
    539548HRESULT HostNetworkInterface::enableStaticIPConfig(const com::Utf8Str &aIPAddress,
    540549                                                   const com::Utf8Str &aNetworkMask)
  • src/VBox/Main/src-server/linux/NetIf-linux.cpp

    diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/src-server/linux/NetIf-linux.cpp VirtualBox-6.1.26/src/VBox/Main/src-server/linux/NetIf-linux.cpp
    old new static int getInterfaceInfo(int iSocket,  
    163163                   sizeof(pInfo->IPNetMask.au8));
    164164
    165165        if (ioctl(iSocket, SIOCGIFFLAGS, &Req) >= 0)
     166        {
    166167            pInfo->enmStatus = Req.ifr_flags & IFF_UP ? NETIF_S_UP : NETIF_S_DOWN;
     168            pInfo->fMaster = Req.ifr_flags & IFF_MASTER;
     169        }
    167170
    168171        struct iwreq WRq;
    169172        RT_ZERO(WRq);

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