summaryrefslogtreecommitdiff
path: root/libnet/include
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2010-02-12 16:42:35 -0800
committerSam Roberts <vieuxtech@gmail.com>2010-02-12 16:42:35 -0800
commit195e7ba365f2a63fcb14d720100103316cebf925 (patch)
tree87a481f0e048fad9b888ea8484818de8a9b717d5 /libnet/include
parent0e319a4e6b2b0e3470f7f49ee977d9cc2407711d (diff)
downloadlibnet-195e7ba365f2a63fcb14d720100103316cebf925.tar.gz
ip_offset is now calculated on the fly, and UDP and TCP no longer use h_len
Diffstat (limited to 'libnet/include')
-rw-r--r--libnet/include/libnet/libnet-functions.h18
-rw-r--r--libnet/include/libnet/libnet-structures.h11
2 files changed, 0 insertions, 29 deletions
diff --git a/libnet/include/libnet/libnet-functions.h b/libnet/include/libnet/libnet-functions.h
index 7a9958c..e009a54 100644
--- a/libnet/include/libnet/libnet-functions.h
+++ b/libnet/include/libnet/libnet-functions.h
@@ -2205,24 +2205,6 @@ libnet_pblock_update(libnet_t *l, libnet_pblock_t *p, uint32_t h, uint8_t type);
/*
- * [Internal]
- * Checksums are a real pain in the <beep>!!!
- * Function updates referer used to compute the checksum. All
- * pblock need to know where is their referer (ie IP header).
- * So, this function is called each time a new IP header is inserted.
- * It updates the ip_offset field (referer) of each previous pblock.
- *
- * FIXME - SR: this approach is fundamentally broken. Any change to any
- * protocol blocks encapsulated in IP cause ip_offset to be invalidated, so
- * essentially every modification of a pblock, if it doesn't search for the
- * previous IP header and change all the offsets, will cause segfaults and
- * other mayhem. Blocks that that need to find the IP header in order to
- * calculate the checksum should do so at checksum calculation time.
- */
-void
-libnet_pblock_record_ip_offset(libnet_t *l, libnet_pblock_t *p);
-
-/*
* [Internal]
* Function locates a given block by it's ptag.
*/
diff --git a/libnet/include/libnet/libnet-structures.h b/libnet/include/libnet/libnet-structures.h
index 901f6b5..cb1697e 100644
--- a/libnet/include/libnet/libnet-structures.h
+++ b/libnet/include/libnet/libnet-structures.h
@@ -89,17 +89,6 @@ struct libnet_protocol_block
* buf that will be included in the checksum, starting from the beginning
* of the header.
*/
- uint32_t ip_offset; /* offset from end of pkt to beginning of IP header */
- /* Unused for IPV4_H block types.
- * For protocols that sit on top of IP (UDP, ICMP, ...), they often
- * include some information from the IP header (in the form of a "pseudo
- * header") in their own checksum calculation. To build that
- * pseudo-header, they need to find the IP header.
- *
- * Note that this mechanism is so fragile, it is essentially a bug, and
- * the main cause of reported segmentaion faults. The IP header should
- * be found by traversing the pblock chain.
- */
uint32_t copied; /* bytes copied - the amount of data copied into buf */
/* Used and updated by libnet_pblock_append(). */
uint8_t type; /* type of pblock */