VirtualBox

Ignore:
Timestamp:
Jan 31, 2011 12:45:37 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69756
Message:

netadp: Re-create configured vboxnetX interfaces (#4213) on Linux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/generic/NetIf-generic.cpp

    r32718 r35785  
    127127
    128128
    129 int NetIfCreateHostOnlyNetworkInterface(VirtualBox *pVBox, IHostNetworkInterface **aHostNetworkInterface, IProgress **aProgress)
     129int NetIfCreateHostOnlyNetworkInterface(VirtualBox *pVBox,
     130                                        IHostNetworkInterface **aHostNetworkInterface,
     131                                        IProgress **aProgress,
     132                                        const char *pcszName)
    130133{
    131134#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
     
    155158                return rc;
    156159            }
    157             strcat(szAdpCtl, "/" VBOXNETADPCTL_NAME " add");
     160            strcat(szAdpCtl, "/" VBOXNETADPCTL_NAME " ");
     161            if (pcszName && strlen(pcszName) <= RTPATH_MAX - strlen(szAdpCtl) - sizeof(" add"))
     162            {
     163                strcat(szAdpCtl, pcszName);
     164                strcat(szAdpCtl, " add");
     165            }
     166            else
     167                strcat(szAdpCtl, "add");
    158168            FILE *fp = popen(szAdpCtl, "r");
    159169
Note: See TracChangeset for help on using the changeset viewer.

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