Fix some IPv6 header related bugs.

- IPv6 payload length calculation didn't count main 40 byte IPv6 header.
- Fix how IPv6 headers that use TLV options are built.
- Fix ip6_hdr_chain$ext_order starting index at 1 instead of 0.
This commit is contained in:
Jon Siwek 2012-03-07 12:40:01 -06:00
parent 9d590456b0
commit 65307764f4
2 changed files with 26 additions and 10 deletions

View file

@ -273,7 +273,7 @@ public:
if ( ip4 )
return ntohs(ip4->ip_len) - ip4->ip_hl * 4;
else
return ntohs(ip6->ip6_plen) - ip6_hdrs->TotalLength();
return ntohs(ip6->ip6_plen) + 40 - ip6_hdrs->TotalLength();
}
uint32 TotalLen() const