VirtualBox

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


Ignore:
Timestamp:
Dec 9, 2008 1:47:04 PM (16 years ago)
Author:
vboxsync
Message:

slirp: properly finish the icmp socket

File:
1 edited

Legend:

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

    r15035 r15168  
    365365udp_detach(PNATState pData, struct socket *so)
    366366{
    367         /* Correctly update list if detaching last socket in list. */
    368         if (so == udp_last_so) udp_last_so = &udb;
    369367#ifndef VBOX_WITH_SLIRP_ICMP
    370         closesocket(so->s);
    371         /* if (so->so_m) m_free(so->so_m);    done by sofree */
    372 
     368    closesocket(so->s);
     369    sofree(pData, so);
     370#else /*! VBOX_WITH_SLIRP_ICMP */
     371    closesocket(so->s);
     372    if (so == &pData->icmp_socket)
     373    {
     374        if (so == udp_last_so)
     375            udp_last_so = &udb;
     376        if (so->so_next && so->so_prev)
     377            remque(pData, so);
     378    }
     379    else
    373380        sofree(pData, so);
    374 #else /*! VBOX_WITH_SLIRP_ICMP */
    375         if (so != &pData->icmp_socket) {
    376             closesocket(so->s);
    377             sofree(pData, so);
    378         }
    379381#endif /* VBOX_WITH_SLIRP_ICMP */
    380382}
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