VirtualBox

Changeset 51703 in vbox


Ignore:
Timestamp:
Jun 23, 2014 11:06:07 PM (10 years ago)
Author:
vboxsync
Message:

NAT/Net: Cosmetics - prefer ip_addr_* APIs to memcpy/memset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/pxping.c

    r51702 r51703  
    514514
    515515        if (g_proxy_options->src4 != NULL) {
    516             memcpy(&iph->src, &g_proxy_options->src4->sin_addr,
    517                    sizeof(g_proxy_options->src4->sin_addr));
     516            ip4_addr_set_u32(&iph->src, g_proxy_options->src4->sin_addr.s_addr);
    518517        }
    519518        else {
    520519            /* let the kernel select suitable source address */
    521             memset(&iph->src, 0, sizeof(iph->src));
     520            ip_addr_set_any(&iph->src);
    522521        }
    523522
     
    17791778    }
    17801779
    1781     memcpy(&target_ip, &oiph->dest, sizeof(target_ip)); /* inner (failed) */
     1780    ip6_addr_copy(target_ip, oiph->dest); /* inner (failed) */
    17821781    target_mapped = pxremap_inbound_ip6(&target_ip, &target_ip);
    17831782    if (target_mapped == PXREMAP_FAILED) {
     
    17861785
    17871786    sys_mutex_lock(&pxping->lock);
    1788     pcb = pxping_pcb_for_reply(pxping, 1, ip_2_ipX(&target_ip), oicmph->id);
     1787    pcb = pxping_pcb_for_reply(pxping, 1, ip6_2_ipX(&target_ip), oicmph->id);
    17891788    if (pcb == NULL) {
    17901789        sys_mutex_unlock(&pxping->lock);
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