VirtualBox

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


Ignore:
Timestamp:
Jul 11, 2012 7:19:03 AM (12 years ago)
Author:
vboxsync
Message:

NAT: TCB releasing on slirp_link_down. (no more assertions on shutdown, not tested)

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
2 edited

Legend:

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

    r41987 r42100  
    462462    while ((so = tcb.so_next) != &tcb)
    463463    {
    464         if (so->so_state & SS_NOFDREF || so->s == -1)
    465             sofree(pData, so);
     464        /* Don't miss TCB releasing */
     465        if (   !sototcpcb(so)
     466            && (   so->so_state & SS_NOFDREF
     467                || so->s == -1))
     468             sofree(pData, so);
    466469        else
    467             tcp_drop(pData, sototcpcb(so), 0);
     470            tcp_close(pData, sototcpcb(so));
    468471    }
    469472
  • trunk/src/VBox/Devices/Network/slirp/tcp_subr.c

    r41455 r42100  
    299299    if (so == tcp_last_so)
    300300        tcp_last_so = &tcb;
    301     closesocket(so->s);
     301    if (so->s != -1)
     302        closesocket(so->s);
    302303    /* Avoid double free if the socket is listening and therefore doesn't have
    303304     * any sbufs reserved. */
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