wrong bitmask format for insertion/removal schemes of list compression
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
rohc | Status tracked in Rohc-main | |||||
1.2.x |
Won't Fix
|
Medium
|
Didier Barvaux | |||
1.3.x |
Won't Fix
|
Medium
|
Didier Barvaux | |||
Rohc-main |
Fix Released
|
Medium
|
Didier Barvaux |
Bug Description
bug in encode_type_2() in c_generic.c:
test: ipv4/ipv6ext/
packet 20: hop-by-hop and destination header.
packet 21: hop-by-hop and destination header disappear
c_generic.c line 1674
Function does not take difference between 7bit and 15bit mask into accout.
In the first octet are only 7bit available, not 8.
And bit 0 is 0.
See 3095: 5.8.6.2.
0 1 2 3 4 5 6 7
| 0 | 7-bit mask | bit 1 is the first bit
| 1 | | bit 1 is the first bit
+---+ 15-bit mask +
| | bit 7 is the last bit
to fix:
replace near line 1672:
byte = 0xff;
with
if (size > 7) byte = 0xff; /* 15 bit mask */
else byte = 0x7f; /* 7 bit mask */
and so on:
for(i = 0; i<size && i < 8; i++)
for(i = 0; i<size && i < 7; i++) // only 7
if (size > 8)
if (size > 7) // 8 to 15