VirtualBox

Changeset 41812 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 18, 2012 11:42:35 AM (12 years ago)
Author:
vboxsync
Message:

NAT: attempt yo fix #6188, don't miss tcp_drop/close on tcp_input.

File:
1 edited

Legend:

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

    r41453 r41812  
    283283        pSocket->fUnderPolling = 0;
    284284        sofree(pData, pSocket);
    285         /* so is PHANTOM, now */
     285        /* pSocket is PHANTOM, now */
    286286        return 1;
    287287    }
     
    10851085
    10861086
     1087/**
     1088 * This function do Connection or sending tcp sequence to.
     1089 * @returns if true operation completed
     1090 * @note: functions call tcp_input that potentially could lead to tcp_drop
     1091 */
    10871092static bool slirpConnectOrWrite(PNATState pData, struct socket *so, bool fConnectOnly)
    10881093{
     
    13531358            )
    13541359        {
    1355             if(!slirpConnectOrWrite(pData, so, false))
     1360            int fConnectOrWriteSuccess = slirpConnectOrWrite(pData, so, false);
     1361            /* slirpConnectOrWrite could return true even if tcp_input called tcp_drop,
     1362             * so we should be ready to such situations.
     1363             */
     1364            if (slirpVerifyAndFreeSocket(pData, so))
     1365                CONTINUE(tcp);
     1366            else if (!fConnectOrWriteSuccess)
    13561367            {
    1357                 if (!slirpVerifyAndFreeSocket(pData, so))
    1358                     so->fUnderPolling = 0;
     1368                so->fUnderPolling = 0;
    13591369                CONTINUE(tcp);
    13601370            }
     1371            /* slirpConnectionOrWrite succeeded and socket wasn't dropped */
    13611372        }
    13621373
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