VirtualBox

Ignore:
Timestamp:
Feb 19, 2009 6:47:45 AM (16 years ago)
Author:
vboxsync
Message:

NAT: non-blocks + socket creation error handling

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

Legend:

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

    r16820 r16938  
    482482    (void) tcp_mss(pData, sototcpcb(so), 0);
    483483
     484    fd_nonblock(inso->s);
    484485    if ((s = accept(inso->s,(struct sockaddr *)&addr,&addrlen)) < 0)
    485486    {
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r16562 r16938  
    366366        addr.sin_port = 0;
    367367        addr.sin_addr.s_addr = INADDR_ANY;
     368        fd_nonblock(so->s);
    368369        if (bind(so->s, (struct sockaddr *)&addr, sizeof(addr)) < 0)
    369370        {
     
    395396        }
    396397    }
     398    else
     399    {
     400        LogRel(("NAT: can't create datagramm socket\n"));
     401    }
    397402    return so->s;
    398403}
     
    703708
    704709    so->s = socket(AF_INET,SOCK_DGRAM,0);
     710    if (so->s == -1)
     711    {
     712        LogRel(("NAT: can't create datagram socket\n "));
     713        RTMemFree(so);
     714        return NULL;
     715    }
    705716    so->so_expire = curtime + SO_EXPIRE;
     717    fd_nonblock(so->s);
    706718    SOCKET_LOCK_CREATE(so);
    707719    QSOCKET_LOCK(udb);
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