Rename tcpudp_cksum to ipv4_pseudoheader_cksum. Partial merge of r21278

from /nmap-exp/david/nmap-ipv6.
This commit is contained in:
david 2011-04-26 15:38:44 +00:00
parent 759426c215
commit afce65a3a8
3 changed files with 11 additions and 9 deletions

View file

@ -553,10 +553,11 @@ unsigned short in_cksum(u16 *ptr,int nbytes) {
}
/* For computing TCP/UDP checksums, see RFC 1071 and TCP/IP Illustrated
sections 3.2, 11.3, and 17.3. */
unsigned short tcpudp_cksum(const struct in_addr *src, const struct in_addr *dst,
u8 proto, u16 len, const void *hstart){
/* Calculate the Internet checksum of some given data concatentated with the
IPv4 pseudo-header. See RFC 1071 and TCP/IP Illustrated sections 3.2, 11.3,
and 17.3. */
unsigned short ipv4_pseudoheader_cksum(const struct in_addr *src,
const struct in_addr *dst, u8 proto, u16 len, const void *hstart) {
struct pseudo {
struct in_addr src;
struct in_addr dst;

View file

@ -183,10 +183,11 @@ int arp_cache_set(struct sockaddr_storage *ss, u8 *mac);
/* Standard BSD internet checksum routine. */
unsigned short in_cksum(u16 *ptr, int nbytes);
/* For computing TCP/UDP checksums, see RFC 1071 and TCP/IP Illustrated
sections 3.2, 11.3, and 17.3.*/
unsigned short tcpudp_cksum(const struct in_addr *src, const struct in_addr *dst,
u8 proto, u16 len, const void *hstart);
/* Calculate the Internet checksum of some given data concatentated with the
IPv4 pseudo-header. See RFC 1071 and TCP/IP Illustrated sections 3.2, 11.3,
and 17.3. */
unsigned short ipv4_pseudoheader_cksum(const struct in_addr *src,
const struct in_addr *dst, u8 proto, u16 len, const void *hstart);
void sethdrinclude(int sd);
void set_ipoptions(int sd, void *opts, size_t optslen);

View file

@ -2995,7 +2995,7 @@ int HostOsScan::send_closedudp_probe(HostOsScanStats *hss,
udp->uh_ulen = htons(8 + datalen);
/* OK, now we should be able to compute a valid checksum */
realcheck = tcpudp_cksum(source, hss->target->v4hostip(), IPPROTO_UDP,
realcheck = ipv4_pseudoheader_cksum(source, hss->target->v4hostip(), IPPROTO_UDP,
sizeof(struct udp_hdr) + datalen, (char *) udp);
#if STUPID_SOLARIS_CHECKSUM_BUG
udp->uh_sum = sizeof(struct udp_hdr) + datalen;