VirtualBox

Changeset 23973 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Oct 22, 2009 12:34:22 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53801
Message:

*,RTFileOpen: Fixing RTFileOpen flag misdesign: The deny, access and action flags are mandatory now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r23923 r23973  
    375375    {
    376376        RTStrmPrintf(buff, sizeof(buff), "%s/RESOLV2", etc);
    377         rc = RTFileOpen(&f, buff, RTFILE_O_READ);
     377        rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    378378    }
    379379    if (RT_FAILURE(rc))
    380380    {
    381381        RTStrmPrintf(buff, sizeof(buff), "%s/RESOLV2", _PATH_ETC);
    382         rc = RTFileOpen(&f, buff, RTFILE_O_READ);
     382        rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    383383    }
    384384    if (RT_FAILURE(rc))
    385385    {
    386386        RTStrmPrintf(buff, sizeof(buff), "%s/resolv.conf", _PATH_ETC);
    387         rc = RTFileOpen(&f, buff, RTFILE_O_READ);
     387        rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    388388    }
    389389#else
    390390# ifndef DEBUG_vvl
    391     rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ);
     391    rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    392392# else
    393393    char *home = getenv("HOME");
    394394    RTStrPrintf(buff, sizeof(buff), "%s/resolv.conf", home);
    395     rc = RTFileOpen(&f, buff, RTFILE_O_READ);
     395    rc = RTFileOpen(&f, buff, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    396396    if (RT_SUCCESS(rc))
    397397    {
     
    400400    else
    401401    {
    402         rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ);
     402        rc = RTFileOpen(&f, "/etc/resolv.conf", RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    403403        Log(("NAT: DNS we're using %s\n", buff));
    404404    }
     
    771771    if (!link_up)
    772772        goto done;
    773    
     773
    774774    /*
    775775     * *_slowtimo needs calling if there are IP fragments
     
    804804        if (pData->fmbuf_water_line == 1)
    805805        {
    806             if (mbuf_alloced < pData->mbuf_water_line_limit/2) 
     806            if (mbuf_alloced < pData->mbuf_water_line_limit/2)
    807807            {
    808808                pData->fmbuf_water_warn_sent = 0;
     
    887887        if (pData->fmbuf_water_line == 1)
    888888        {
    889             if (mbuf_alloced < pData->mbuf_water_line_limit/2) 
     889            if (mbuf_alloced < pData->mbuf_water_line_limit/2)
    890890            {
    891891                pData->fmbuf_water_line = 0;
     
    10271027        if (pData->fmbuf_water_line == 1)
    10281028        {
    1029             if (mbuf_alloced < pData->mbuf_water_line_limit/2) 
     1029            if (mbuf_alloced < pData->mbuf_water_line_limit/2)
    10301030            {
    10311031                pData->fmbuf_water_line = 0;
     
    13241324        if (pData->fmbuf_water_line == 1)
    13251325        {
    1326             if (mbuf_alloced < pData->mbuf_water_line_limit/2) 
     1326            if (mbuf_alloced < pData->mbuf_water_line_limit/2)
    13271327            {
    13281328                pData->fmbuf_water_line = 0;
     
    15491549        return;
    15501550    }
    1551     eh = mtod(m, struct ethhdr *); 
     1551    eh = mtod(m, struct ethhdr *);
    15521552    proto = ntohs(eh->h_proto);
    15531553#else
     
    16211621#endif
    16221622#if 1
    1623             if (   pData->fmbuf_water_line 
     1623            if (   pData->fmbuf_water_line
    16241624                && pData->fmbuf_water_warn_sent == 0
    16251625                && (curtime - pData->tsmbuf_water_warn_sent) > 500)
    16261626            {
    1627                 icmp_error(pData, m, ICMP_SOURCEQUENCH, 0, 0, "Out of resources!!!"); 
     1627                icmp_error(pData, m, ICMP_SOURCEQUENCH, 0, 0, "Out of resources!!!");
    16281628                pData->fmbuf_water_warn_sent = 1;
    16291629                pData->tsmbuf_water_warn_sent = curtime;
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