commit ca90da66ac237005af6fbdbdc16837ba41f19beb
Author: Jordan Ritter <jpr5@darkridge.com>
Date: Tue Jun 19 10:12:08 2007 +0000
Fix for bug #1738953: why would I subtract the payload's length from a
variable that is supposed to describe exactly that?? Removed ip6_plen
from TCP, UDP and ICMPv6 calculations.
diff --git a/ngrep.c b/ngrep.c
index fd95cbe..6c3c902 100644
@@ -721,11 +721,6 @@ void process(u_char *d, struct pcap_pkthdr *h, u_char *p) {
data = (unsigned char *)(tcp_pkt) + tcphdr_offset;
len -= link_offset + ip_hl + tcphdr_offset;
- len -= ntohs(ip6_pkt->ip6_plen);
@@ -741,11 +736,6 @@ void process(u_char *d, struct pcap_pkthdr *h, u_char *p) {
data = (unsigned char *)(udp_pkt) + udphdr_offset;
len -= link_offset + ip_hl + udphdr_offset;
- len -= ntohs(ip6_pkt->ip6_plen);
@@ -779,7 +769,7 @@ void process(u_char *d, struct pcap_pkthdr *h, u_char *p) {
uint16_t icmp6hdr_offset = (frag_offset) ? 0 : 4;
data = (unsigned char *)(icmp6_pkt) + icmp6hdr_offset;
- len -= link_offset + ip_hl + ntohs(ip6_pkt->ip6_plen) + icmp6hdr_offset;
+ len -= link_offset + ip_hl + icmp6hdr_offset;