Ticket #40792: ngrep-fix-ipv6-support.patch
File ngrep-fix-ipv6-support.patch, 1.2 KB (added by akhenakh (Fabrice Aneche), 11 years ago) |
---|
-
ngrep.c
void process(u_char *d, struct pcap_pkth 711 711 data = (unsigned char *)(tcp_pkt) + tcphdr_offset; 712 712 len -= link_offset + ip_hl + tcphdr_offset; 713 713 714 /* 714 715 #if USE_IPv6 715 716 if (ip_ver == 6) 716 717 len -= ntohs(ip6_pkt->ip6_plen); 717 #endif 718 #endif 719 */ 718 720 719 721 if ((int32_t)len < 0) 720 722 len = 0; … … void process(u_char *d, struct pcap_pkth 731 733 data = (unsigned char *)(udp_pkt) + udphdr_offset; 732 734 len -= link_offset + ip_hl + udphdr_offset; 733 735 736 /* 734 737 #if USE_IPv6 735 738 if (ip_ver == 6) 736 739 len -= ntohs(ip6_pkt->ip6_plen); 737 740 #endif 738 741 */ 739 742 if ((int32_t)len < 0) 740 743 len = 0; 741 744 … … void process(u_char *d, struct pcap_pkth 769 772 uint16_t icmp6hdr_offset = (frag_offset) ? 0 : 4; 770 773 771 774 data = (unsigned char *)(icmp6_pkt) + icmp6hdr_offset; 772 len -= link_offset + ip_hl + ntohs(ip6_pkt->ip6_plen) +icmp6hdr_offset;775 len -= link_offset + ip_hl + icmp6hdr_offset; 773 776 774 777 if ((int32_t)len < 0) 775 778 len = 0;