VirtualBox

Changeset 14283 in vbox


Ignore:
Timestamp:
Nov 18, 2008 10:31:24 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39461
Message:

Linux hostif: Only Ethernet interfaces gets listed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HostImpl.cpp

    r14271 r14283  
    4444# include <errno.h>
    4545# include <net/if.h>
     46# include <net/if_arp.h>
    4647#endif /* RT_OS_LINUX */
    4748
     
    10301031            for (struct ifreq *pReq = ifConf.ifc_req; (char*)pReq < pBuffer + ifConf.ifc_len; pReq++)
    10311032            {
    1032                 RTUUID uuid;
    1033                 Assert(sizeof(uuid) <= sizeof(*pReq));
    1034                 memcpy(&uuid, pReq, sizeof(uuid));
    1035 
    1036                 ComObjPtr<HostNetworkInterface> IfObj;
    1037                 IfObj.createObject();
    1038                 if (SUCCEEDED(IfObj->init(Bstr(pReq->ifr_name), Guid(uuid))))
    1039                     list.push_back(IfObj);
     1033                if (ioctl(sock, SIOCGIFHWADDR, pReq) >= 0)
     1034                {
     1035                    if (pReq->ifr_hwaddr.sa_family == ARPHRD_ETHER)
     1036                    {
     1037                        RTUUID uuid;
     1038                        Assert(sizeof(uuid) <= sizeof(*pReq));
     1039                        memcpy(&uuid, pReq, sizeof(uuid));
     1040
     1041                        ComObjPtr<HostNetworkInterface> IfObj;
     1042                        IfObj.createObject();
     1043                        if (SUCCEEDED(IfObj->init(Bstr(pReq->ifr_name), Guid(uuid))))
     1044                            list.push_back(IfObj);
     1045                    }
     1046                }
    10401047            }
    10411048        }
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