VirtualBox

Ticket #5747: vbox_fSharedMacOnWire.patch

File vbox_fSharedMacOnWire.patch, 1.7 KB (added by guanx, 11 years ago)

Enable fSharedMacOnWire for bonding interface

  • src/VBox/Main/src-client/ConsoleImpl2.cpp

    old new int Console::configNetwork(const char *p  
    45414541                int iSock = socket(AF_INET, SOCK_DGRAM, 0);
    45424542                if (iSock >= 0)
    45434543                {
     4544                    bool fSharedMacOnWire = false;
     4545                    struct ifreq Rq;
    45444546                    struct iwreq WRq;
    45454547
    4546                     RT_ZERO(WRq);
    4547                     strncpy(WRq.ifr_name, pszBridgedIfName, IFNAMSIZ);
    4548                     bool fSharedMacOnWire = ioctl(iSock, SIOCGIWNAME, &WRq) >= 0;
     4548                    RT_ZERO(Rq);
     4549                    strncpy(Rq.ifr_name, pszBridgedIfName, IFNAMSIZ);
     4550                    if(ioctl(iSock, SIOCGIFFLAGS, &Rq) == -1)
     4551                    {
     4552                        Log(("Failed to get interface flags\n"));
     4553                    }
     4554                    else
     4555                    {
     4556                        if(Rq.ifr_flags & IFF_MASTER)
     4557                        {
     4558                            fSharedMacOnWire = true;
     4559                            Log(("Will force SharedMacOnWire on bonding interface\n"));
     4560                        }
     4561                        else
     4562                        {
     4563                            RT_ZERO(WRq);
     4564                            strncpy(WRq.ifr_name, pszBridgedIfName, IFNAMSIZ);
     4565                            fSharedMacOnWire = (ioctl(iSock, SIOCGIWNAME, &WRq) >= 0);
     4566                        }
     4567                    }
    45494568                    close(iSock);
    45504569                    if (fSharedMacOnWire)
    45514570                    {

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