TODO: handle generic_static_irregular() encoding missing
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
rohc | Status tracked in Rohc-main | |||||
Rohc-1.7.x |
Won't Fix
|
Low
|
Didier Barvaux | |||
Rohc-2.0.x |
Won't Fix
|
Undecided
|
Unassigned | |||
Rohc-main |
Confirmed
|
Low
|
Didier Barvaux |
Bug Description
TODO: in what case option_static could be set to 1 ?
I guess if a generic option do not change at all.
Maybe someone have a deeper knowledge which options
are stay unchanged due to the stream lifetime, but
I haven't. I use this, if the option it at the second
occurrence is unchanged. If it changes only once,
I use option_static == 0. There is no way back to
option_static == 1. That is, option_static == 0 is
my default value. This can be improved, if it is
well known, which options are type is static by design.
However, in test ipv4_tcp_
a generic option is unchanged. To test this, I added this:
diff --git a/src/decomp/
index 0fef714..612d84b 100644
--- a/src/decomp/
+++ b/src/decomp/
@@ -1294,12 +1318,13 @@ static int d_tcp_parse_
persist = &tcp_context-
- /* TODO: in what case option_static could be set to 1 ? */
if(persist-
{
- /* TODO: handle generic_
- rohc_decomp_
- goto error;
+ const size_t opt_load_len = persist-
+
+ opt_ctxt-
+ memcpy(
+ rohc_decomp_
}
else if(persist-
{
The code is the same as for generic_
It takes the contents from the context.
Maybe you want to extract it into a function.
Best,
Klaus Warnke
Hello,
this patch and the patch regarding the generic_static stuff is incomplete.
If the generic option is static, the option_static flag must be copied
around with the other fields too.
I do something like this there:
if(persist- >data.generic. option_ static == 1) >data.generic = persist- >data.generic; decomp_ debug(context, "TCP generic option payload = %u bytes", persist- >data.generic. load_len) ;
{
opt_ctxt-
rohc_
}
instead of copy each struct element explicit. You prefer memcpy to avoid alignment issues.
Yeah, everything works on a Intel box, but if go to ARM strange things happens...
On a SPARC platform you may receive a SIGBUS, which helps.
But I assume, If there is a alignment problem, then there is a problem using
the "->" operator with this struct at all, not only when coping the whole data.
This option_static problem is the same here:
if(discriminator == 0xff) ctxt->data. generic = persist- >data.generic; decomp_ debug(context, "TCP generic option payload = %u bytes", persist- >data.generic. load_len) ;
{
opt_
rohc_
}
If no data received, the ->option_static flag must be copied too.
Or explicit:
I guess, in the case
else if(discriminator == 0x00) ctxt->data. generic. option_ static = 0; ctxt->data. generic. load_len = opt_load_len; opt_ctxt- >data.generic. load, data + read, opt_load_len); decomp_ debug(context, "TCP generic option payload = %zu bytes", opt_load_len);
{
...
opt_
opt_
memcpy(
read += opt_load_len;
rohc_
Best,
Klaus Warnke