VirtualBox

Changeset 41227 in vbox for trunk/src


Ignore:
Timestamp:
May 10, 2012 6:10:17 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77873
Message:

NAT: don't touch anything, except fShouldBeRemoved, when sofree called with fUnderPolling.

File:
1 edited

Legend:

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

    r41198 r41227  
    183183sofree(PNATState pData, struct socket *so)
    184184{
     185    LogFlowFunc(("ENTER:%R[natsock]\n", so));
     186    /*
     187     * We should not remove socket when polling routine do the polling
     188     * instead we mark it for deletion.
     189     */
     190    if (so->fUnderPolling)
     191    {
     192        so->fShouldBeRemoved = 1;
     193        LogFlowFunc(("LEAVE:%R[natsock] postponed deletion\n", so));
     194        return;
     195    }
    185196    if (so == tcp_last_so)
    186197        tcp_last_so = &tcb;
    187198    else if (so == udp_last_so)
    188199        udp_last_so = &udb;
     200
     201#ifndef VBOX_WITH_SLIRP_MT
     202
    189203    /* libalias notification */
    190204    if (so->so_pvLnk)
    191205        slirpDeleteLinkSocket(so->so_pvLnk);
    192 
    193206    /* check if mbuf haven't been already freed  */
    194207    if (so->so_m != NULL)
     208    {
    195209        m_freem(pData, so->so_m);
    196 #ifndef VBOX_WITH_SLIRP_MT
    197     /*
    198      * We should not remove socket when polling routine do the polling
    199      * instead we mark it for deletion.
    200      */
    201     if (!so->fUnderPolling)
    202     {
    203         if (so->so_next && so->so_prev)
    204         {
    205             remque(pData, so);  /* crashes if so is not in a queue */
    206             NSOCK_DEC();
    207         }
    208 
    209         RTMemFree(so);
    210     }
    211     else
    212         so->fShouldBeRemoved = 1;
     210        so->so_m = NULL;
     211    }
     212
     213    if (so->so_next && so->so_prev)
     214    {
     215        remque(pData, so);  /* crashes if so is not in a queue */
     216        NSOCK_DEC();
     217    }
     218
     219    RTMemFree(so);
    213220#else
    214221    so->so_deleted = 1;
    215222#endif
     223    LogFlowFuncLeave();
    216224}
    217225
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