A problem in OpenBSC, sccp.c

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Thu Oct 21 09:28:24 UTC 2010


On 10/21/2010 10:23 AM, Wenbin Wu wrote:
> Hello,

Hi,


> 
> I have a problem in sccp.c.
> 
> 537--543
>     udt->type = SCCP_MSG_TYPE_UDT;
>     udt->proto_class = class;
>     udt->variable_called = 3;
>     udt->variable_calling = 5 + out->gti_len;
>     if(out->use_poi) udt->variable_calling += 2;
>     udt->variable_data = 7 + out->gti_len + in->gti_len;
>     if(in->use_poi) udt->variable_calling += 2;

I think it would be valuable if you make yourself familiar with git. At least
git diff to be able to see difference from your original to this version.


> 
> I add these two 'if' lines in the code. I'm not sure if it is right.
> In source code, before it calls 'create_sccp_addr', it sets the length only
> using gti_len. But in 'create_sccp_addr', if I use poi, the length should be
> add 2.
> 
> Am I right?

Yes, you are right. Do you care to fix it? create_sccp_addr should be changed
to return the number of bytes it used for writing the address, and then we
would update the variable_called and variable_calling with the real size of
the addr. This way the code will work even after we add more addressing options.



holger




More information about the OpenBSC mailing list