VirtualBox

Changeset 16788 in vbox for trunk/src


Ignore:
Timestamp:
Feb 16, 2009 1:34:24 PM (16 years ago)
Author:
vboxsync
Message:

NAT: get rid of assert on write opperation, giving TCP/IP stack handle the case connection will be restored or expired by system.
in the last case we should receive POLLRDHUP and POLLERR without and any IO op. bit set and let the Slirp validly termincate corresponding connection
with guest.

File:
1 edited

Legend:

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

    r16768 r16788  
    11321132                 */
    11331133#endif
    1134 
    11351134                if (   so->so_state & SS_ISFCONNECTING
    11361135                    || UNIX_CHECK_FD_SET(so, NetworkEvents, readfds))
     
    11441143                        /*
    11451144                         * Never meet inq != 0 or outq != 0, anyway let it stay for a while
    1146                          * in case it happens we'll able to detect it.
     1145                         * in case it happens we'll able to detect it.
     1146                         * Give TCP/IP stack wait or expire the socket.
    11471147                         */
    11481148                        LogRel(("NAT:%R[natsock] err(%d:%s) s(in:%d,out:%d)happens on read I/O, "
    11491149                            "other side close connection \n", so, err, strerror(err), inq, outq));
     1150                        CONTINUE(tcp);
    11501151                    }
    1151                     so->so_state = SS_NOFDREF;
    1152                     TCP_INPUT(pData, (struct mbuf *)NULL, sizeof(struct ip), so);
    1153                     CONTINUE(tcp);
     1152                    goto tcp_input_close;
     1153                }
     1154                if (   !UNIX_CHECK_FD_SET(so, NetworkEvents, readfds)
     1155                    && !UNIX_CHECK_FD_SET(so, NetworkEvents, writefds)
     1156                    && !UNIX_CHECK_FD_SET(so, NetworkEvents, xfds))
     1157                {
     1158                    LogRel(("NAT:system expires the socket %R[natsock] err(%d:%s) s(in:%d,out:%d) happens on non-I/O. "
     1159                            so, err, strerror(err), inq, outq));
     1160                    goto tcp_input_close;
    11541161                }
    11551162                LogRel(("NAT:%R[natsock] we've met(%d:%s) s(in:%d, out:%d) unhandled combination hup (%d) "
     
    11631170                        UNIX_CHECK_FD_SET(so, ign, xfds)));
    11641171                /*
    1165                  * Here should be other error handlings
    1166                  * The error handling code above handles the errors can happens on reading
    1167                  * we haven't still met any cases of error on write.
     1172                 * Give OS's TCP/IP stack a chance to resolve an issue or expire the socket.
    11681173                 */
    1169                 AssertRelease(!"shouldn't be here!!!");
     1174                CONTINUE(tcp);
     1175tcp_input_close:
     1176                so->so_state = SS_NOFDREF; /*cause connection valid tcp connection termination and socket closing */
     1177                TCP_INPUT(pData, (struct mbuf *)NULL, sizeof(struct ip), so);
     1178                CONTINUE(tcp);
    11701179            }
    11711180#endif
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