VirtualBox

Ignore:
Timestamp:
Nov 3, 2016 3:30:38 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111715
Message:

NAT: bugref:8634 - restrict the fix in r111333 (bugref:8573) to Linux
for now. Requires more testing on other hosts as poll events and
error reporting from socket syscalls seems to differ quite a bit in
these scenarios.

File:
1 edited

Legend:

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

    r64346 r64534  
    377377            else
    378378            {
    379                 LogRel2(("NAT: sockerr %d, shuterr %d - %R[natsock]\n", sockerr, shuterr, so));
     379                LogRel(("NAT: sockerr %d, shuterr %d - %R[natsock]\n", sockerr, shuterr, so));
    380380                tcp_drop(pData, sototcpcb(so), sockerr);
    381381            }
     
    11181118         * If remote closes first and then sends an RST, the recv() in
    11191119         * soread() will keep reporting EOF without any error
    1120          * indication, so we must also check if shutdown() succeeds
    1121          * here.
     1120         * indication.  As far as I can tell the only way to detect
     1121         * this on Linux is to check if shutdown() succeeds here (but
     1122         * see below).
     1123         *
     1124         * OTOH on OS X shutdown() "helpfully" checks if remote has
     1125         * already closed and then always returns ENOTCONN
     1126         * immediately.
    11221127         */
    1123         int status = shutdown(so->s, 0);
     1128        int status = shutdown(so->s, SHUT_RD);
     1129#if defined(RT_OS_LINUX)
    11241130        if (status < 0)
    11251131            err = errno;
     1132#else
     1133        RT_NOREF(status);
     1134#endif
    11261135    }
    11271136    so->so_state &= ~(SS_ISFCONNECTING);
    11281137    if (so->so_state & SS_FCANTSENDMORE)
    11291138    {
     1139#if defined(RT_OS_LINUX)
    11301140        /*
    11311141         * If we have closed first, and remote closes, shutdown will
     
    11351145        if (err == ENOTCONN)
    11361146            err = 0;
     1147#endif
    11371148        so->so_state = SS_NOFDREF; /* Don't select it */
    11381149                                   /* XXX close() here as well? */
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