VirtualBox

Changeset 72276 in vbox for trunk/src


Ignore:
Timestamp:
May 21, 2018 1:14:28 PM (7 years ago)
Author:
vboxsync
Message:

NAT: udp_attach - prettify a bit.

File:
1 edited

Legend:

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

    r72274 r72276  
    534534    so->so_type = IPPROTO_UDP;
    535535
    536     if ((so->s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
     536    so->s = socket(AF_INET, SOCK_DGRAM, 0);
     537    if (so->s == -1)
    537538        goto error;
     539    fd_nonblock(so->s);
     540
    538541    so->so_sottl = 0;
    539542    so->so_sotos = 0;
    540543    so->so_sodf = -1;
    541544
    542     fd_nonblock(so->s);
    543 
    544545    status = sobind(pData, so);
    545546    if (status != 0)
     
    548549    /* success, insert in queue */
    549550    so->so_expire = curtime + SO_EXPIRE;
     551
    550552    /* enable broadcast for later use */
    551553    setsockopt(so->s, SOL_SOCKET, SO_BROADCAST, (const char *)&opt, sizeof(opt));
     554
    552555    status = getsockname(so->s, &sa_addr, &socklen);
    553556#if 0 /** @todo  Something is explitived here! Temporarily disabled this annoying assertion.  Re-enable when fixed.  */
     
    564567    return so->s;
    565568error:
    566     Log2(("NAT: can't create datagramm socket\n"));
     569    Log2(("NAT: can't create datagram socket\n"));
    567570    return -1;
    568571}
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