VirtualBox

Changeset 49617 in vbox for trunk/src


Ignore:
Timestamp:
Nov 21, 2013 11:48:29 PM (11 years ago)
Author:
vboxsync
Message:

Add a few comments.

File:
1 edited

Legend:

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

    r49616 r49617  
    946946    }
    947947
     948
     949    /*
     950     * Is this a reply to one of our pings?
     951     */
     952
    948953    ip_addr_copy(target_ip, iph->src);
    949954    mapped = pxremap_inbound_ip4(&target_ip, &target_ip);
     
    971976
    972977    sys_mutex_unlock(&pxping->lock);
     978
     979
     980    /*
     981     * Rewrite headers and forward to guest.
     982     */
    973983
    974984    /* rewrite ICMP echo header */
     
    10181028    icmph = (struct icmp_echo_hdr *)(pollmgr_udpbuf + IP_HLEN);
    10191029
     1030    /*
     1031     * Inner IP datagram is not checked by the kernel and may be
     1032     * anything, possibly malicious.
     1033     */
     1034
    10201035    oipoff = IP_HLEN + ICMP_HLEN;
    10211036    oiplen = iplen - oipoff; /* NB: truncated length, not IPH_LEN(oiph) */
     
    10731088        DPRINTF2(("%s: ping %s id 0x%x seq %d",
    10741089                  __func__, addrstr, ntohs(id), ntohs(seq)));
    1075     }
    1076 
    1077     if (ICMPH_TYPE(icmph) == ICMP_DUR) {
    1078         DPRINTF2((" unreachable (code %d)\n", ICMPH_CODE(icmph)));
    1079     }
    1080     else {
    1081         DPRINTF2((" time exceeded\n"));
    1082     }
     1090        if (ICMPH_TYPE(icmph) == ICMP_DUR) {
     1091            DPRINTF2((" unreachable (code %d)\n", ICMPH_CODE(icmph)));
     1092        }
     1093        else {
     1094            DPRINTF2((" time exceeded\n"));
     1095        }
     1096    }
     1097
     1098
     1099    /*
     1100     * Is the inner (failed) datagram one of our pings?
     1101     */
    10831102
    10841103    ip_addr_copy(target_ip, oiph->dest); /* inner (failed) */
     
    11031122
    11041123    sys_mutex_unlock(&pxping->lock);
     1124
     1125
     1126    /*
     1127     * Rewrite both inner and outer headers and forward to guest.
     1128     * Note that the checksum of the outer ICMP error message is
     1129     * preserved by the changes we do to inner headers.
     1130     */
    11051131
    11061132    ip_addr_copy(error_ip, iph->src); /* node that reports the error */
     
    11301156    sum = FOLD_U32T(sum);
    11311157    IPH_CHKSUM_SET(oiph, ~sum);
    1132 
    1133     /* keep outer ICMP error header: checksum not affected by the above */
    11341158
    11351159    /* rewrite outer IP header */
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