Opened 23 months ago
Closed 22 months ago
#313 closed defect (duplicate)
sorry for duplicate ticket by mistake. Please cancel this one.
| Reported by: | Rong Zheng | Owned by: | salcock |
|---|---|---|---|
| Priority: | major | Milestone: | libtrace3 |
| Component: | libtrace-library | Version: | 3.0 |
| Keywords: | ipv6 | Cc: |
Description
The length of extension header field is defined in RFC as follows, take Hop-by-Hop header for example:
8-bit unsigned integer. Length of the Hop-by-Hop Options header in 8-octet units, not including the first 8 octets.
So the len filed in libtrace_ip6_ext_t should be:
len=(((libtrace_ip6_ext_t*)payload)->len + 1) * 8;
I have attached a ipv6 packet(pcap file) within two extension headers for testing.
diff -Nur ./lib/protocols_l3.c ../libtrace-3.0.11_rong/lib/protocols_l3.c
--- ./lib/protocols_l3.c 2011-07-11 21:19:47.000000000 +0800
+++ ../libtrace-3.0.11_rong/lib/protocols_l3.c 2011-07-11 21:14:47.000000000 +0800
@@ -156,12 +156,10 @@
switch (nxt) {
case 0: /* hop by hop options */
case TRACE_IPPROTO_ROUTING:
- case TRACE_IPPROTO_ESP:
case TRACE_IPPROTO_AH:
case TRACE_IPPROTO_DSTOPTS:
{
- len=((libtrace_ip6_ext_t*)payload)->len
- +sizeof(libtrace_ip6_ext_t);
+ len=(((libtrace_ip6_ext_t*)payload)->len + 1) * 8;
if (remaining) {
if (*remaining < len) {
@@ -191,7 +189,11 @@
payload=(char*)payload+len;
continue;
}
-
+ case TRACE_IPPROTO_ESP:
+ {
+ if (prot) *prot=TRACE_IPPROTO_ESP; //the remain part of this packet is encrypted
+ return payload;
+ }
default:
if (prot) *prot=nxt;
return payload;
Change History (2)
comment:1 Changed 23 months ago by Rong Zheng <jeromezhr@…>
- Summary changed from PATCH for trace_get_payload_from_ip6() doesn't get extension header length correctly to sorry for duplicate ticket by mistake. Please cancel this one.
comment:2 Changed 22 months ago by salcock
- Resolution set to duplicate
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
