VirtualBox

Changeset 15443 in vbox


Ignore:
Timestamp:
Dec 13, 2008 1:57:35 PM (16 years ago)
Author:
vboxsync
Message:

slirp:icmp: Fix of ttl setting on Darwin

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

Legend:

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

    r15407 r15443  
    278278    int status;
    279279    uint32_t dst;
     280    int ttl;
    280281
    281282    /* int code; */
     
    408409                /* Send the packet */
    409410# ifndef RT_OS_WINDOWS
    410                 LogRel(("NAT/ICMP: try to set TTL(%d)\n", ip->ip_ttl));
    411                 status = setsockopt(pData->icmp_socket.s, IPPROTO_IP, IP_TTL, (void *)&ip->ip_ttl, sizeof(ip->ip_ttl));
     411                ttl = ip->ip_ttl;
     412                LogRel(("NAT/ICMP: try to set TTL(%d)\n", ttl));
     413                status = setsockopt(pData->icmp_socket.s, IPPROTO_IP, IP_TTL, (void *)&ttl, sizeof(ttl));
    412414                if (status < 0)
    413415                {
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r15355 r15443  
    7373    struct socket *so;
    7474#ifdef VBOX_WITH_SLIRP_ICMP
    75         int ret;
     75    int ret;
     76    int ttl;
    7677#endif
    7778
     
    245246
    246247#ifdef VBOX_WITH_SLIRP_ICMP
    247     ip->ip_ttl = save_ip.ip_ttl;
    248     ret = setsockopt(so->s, IPPROTO_IP, IP_TTL, (void *)&ip->ip_ttl, sizeof(ip->ip_ttl));
     248    ttl = ip->ip_ttl = save_ip.ip_ttl;
     249    ret = setsockopt(so->s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
    249250    if (ret < 0) {
    250251        LogRel(("NAT: Error (%s) occurred while setting TTL(%d) attribute of IP packet to socket %R[natsock]\n", strerror(errno), ip->ip_ttl, so));
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