VirtualBox

Changeset 72292 in vbox for trunk/src


Ignore:
Timestamp:
May 22, 2018 11:42:27 PM (7 years ago)
Author:
vboxsync
Message:

NAT: sobind - untabify.

File:
1 edited

Legend:

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

    r72283 r72292  
    184184    if (addr == INADDR_ANY && port == 0 && so->so_type != IPPROTO_UDP)
    185185    {
    186         /* TCP sockets without constraints don't need to be bound */
    187         Log2(("NAT: sobind: %s guest %RTnaipv4:%d - nothing to do\n",
    188               so->so_type == IPPROTO_UDP ? "udp" : "tcp",
    189               so->so_laddr.s_addr, ntohs(so->so_lport)));
    190         return 0;
     186        /* TCP sockets without constraints don't need to be bound */
     187        Log2(("NAT: sobind: %s guest %RTnaipv4:%d - nothing to do\n",
     188              so->so_type == IPPROTO_UDP ? "udp" : "tcp",
     189              so->so_laddr.s_addr, ntohs(so->so_lport)));
     190        return 0;
    191191    }
    192192
     
    202202    if (status == 0)
    203203    {
    204         Log2(("NAT: sobind: %s guest %RTnaipv4:%d to host %RTnaipv4:%d\n",
    205               so->so_type == IPPROTO_UDP ? "udp" : "tcp",
    206               so->so_laddr.s_addr, ntohs(so->so_lport), addr, ntohs(port)));
    207         return 0;
     204        Log2(("NAT: sobind: %s guest %RTnaipv4:%d to host %RTnaipv4:%d\n",
     205              so->so_type == IPPROTO_UDP ? "udp" : "tcp",
     206              so->so_laddr.s_addr, ntohs(so->so_lport), addr, ntohs(port)));
     207        return 0;
    208208    }
    209209
    210210    Log2(("NAT: sobind: %s guest %RTnaipv4:%d to host %RTnaipv4:%d error %d%s\n",
    211           so->so_type == IPPROTO_UDP ? "udp" : "tcp",
    212           so->so_laddr.s_addr, ntohs(so->so_lport),
    213           addr, ntohs(port),
    214           errno, port ? " (will retry with random port)" : ""));
     211          so->so_type == IPPROTO_UDP ? "udp" : "tcp",
     212          so->so_laddr.s_addr, ntohs(so->so_lport),
     213          addr, ntohs(port),
     214          errno, port ? " (will retry with random port)" : ""));
    215215
    216216    if (port) /* retry without */
    217         status = sobindto(so, addr, 0);
     217        status = sobindto(so, addr, 0);
    218218
    219219    if (addr)
    220         return status;
     220        return status;
    221221    else
    222         return 0;
     222        return 0;
    223223}
    224224
     
    241241        int opt = 1;
    242242        setsockopt(so->s, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt));
    243         port = so->so_lport;
     243        port = so->so_lport;
    244244    }
    245245    else
    246246    {
    247         port = 0;
     247        port = 0;
    248248    }
    249249
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