VirtualBox

Changeset 30415 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 24, 2010 9:02:31 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63044
Message:

NAT: comments

File:
1 edited

Legend:

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

    r30404 r30415  
    6161#endif
    6262
    63 #ifdef RT_OS_WINDOWS
    64 # define ICMP_SEND_ECHO(event, routine, addr, data, datasize, ipopt)                                        \
    65                 IcmpSendEcho2(pData->icmp_socket.sh, (event), NULL, NULL, (addr), (data), (datasize),       \
    66                                (ipopt), pData->pvIcmpBuffer, pData->szIcmpBuffer, 1)
    67 #endif /* RT_OS_WINDOWS */
    68 
    6963/* The message sent when emulating PING */
    7064/* Be nice and tell them it's just a psuedo-ping packet */
     
    355349        /* min 8 bytes payload */
    356350        icmpstat.icps_tooshort++;
    357         goto end_error;
     351        goto end_error_free_m;
    358352    }
    359353
     
    364358    {
    365359        icmpstat.icps_checksum++;
    366         goto end_error;
     360        goto end_error_free_m;
    367361    }
    368362
     
    373367        {
    374368            LogRel(("NAT: not enought memory to allocate the buffer\n"));
    375             goto end_error;
     369            goto end_error_free_m;
    376370        }
    377371        m_copydata(m, 0, icmplen, icp_buf);
     
    443437                        goto done;
    444438                    }
    445                    
     439
    446440                    LogRel((dfd,"icmp_input udp sendto tx errno = %d-%s\n",
    447441                                errno, strerror(errno)));
     
    454448                memset(&ipopt, 0, sizeof(IP_OPTION_INFORMATION));
    455449                ipopt.Ttl = ip->ip_ttl;
    456                 status = ICMP_SEND_ECHO(pData->phEvents[VBOX_ICMP_EVENT_INDEX], notify_slirp, addr.sin_addr.s_addr,
    457                                 icp->icmp_data, icmplen - ICMP_MINLEN, &ipopt);
     450                status = IcmpSendEcho2(pData->icmp_socket.sh /*=handle*/,
     451                                       pData->phEvents[VBOX_ICMP_EVENT_INDEX] /*=Event*/,
     452                                       NULL /*=ApcRoutine*/,
     453                                       NULL /*=ApcContext*/,
     454                                       addr.sin_addr.s_addr /*=DestinationAddress*/,
     455                                       icp->icmp_data /*=RequestData*/,
     456                                       icmplen - ICMP_MINLEN /*=RequestSize*/,
     457                                       &ipopt /*=RequestOptions*/,
     458                                       pData->pvIcmpBuffer /*=ReplyBuffer*/,
     459                                       pData->szIcmpBuffer /*=ReplySize*/,
     460                                       1 /*=Timeout in ms*/);
    458461                error = GetLastError();
    459                 if (   status != 0 
     462                if (   status != 0
    460463                    || error == ERROR_IO_PENDING)
    461464                {
     465                    /* no error! */
    462466                    m->m_so = &pData->icmp_socket;
    463467                    icmp_attach(pData, m);
     
    489493        case ICMP_UNREACH:
    490494        case ICMP_TIMXCEED:
    491             /* @todo(vvl): both up cases comes from guest, 
    492              *  indeed right solution would be find the socket 
    493              *  corresponding to ICMP data and close it. 
     495            /* @todo(vvl): both up cases comes from guest,
     496             *  indeed right solution would be find the socket
     497             *  corresponding to ICMP data and close it.
    494498             */
    495499        case ICMP_PARAMPROB:
     
    504508            icmpstat.icps_badtype++;
    505509    } /* switch */
    506    
    507 end_error:
     510
     511end_error_free_m:
    508512    m_freem(pData, m);
    509513
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette