Hello,
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 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?
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
On 10/21/2010 11:28 AM, Holger Hans Peter Freyther wrote:
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.
there is also one more place where it is wrong. It would be nice if you could come up with a patch.
On 10/21/2010 10:23 AM, Wenbin Wu wrote:
Hello,
Hi,
it would be nice if you could test the latest version of libosmo-sccp. I have made the sccp_create_addr public[1], I have changed the creation of the address to set the size correctly[2] and I have used the return value of the sccp_create_addr[3] to update the variable_called and such.
The added test case in [2] is still only checking address creation with only a SSN. It would be nice if any of you in sweden could add a test case for POI.
I hope you will be able to try this. z.
[1] http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=ec5409ca4f46c308... [2] http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=13cd1199b92b9824... [3] http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=6ecf8104c0e2fd6e...
Hi Holger,
I will try to do this next week, since I have something to do this week. Thanks for noticing.
On 2010-11-16, at 下午9:02, Holger Hans Peter Freyther wrote:
On 10/21/2010 10:23 AM, Wenbin Wu wrote:
Hello,
Hi,
it would be nice if you could test the latest version of libosmo-sccp. I have made the sccp_create_addr public[1], I have changed the creation of the address to set the size correctly[2] and I have used the return value of the sccp_create_addr[3] to update the variable_called and such.
The added test case in [2] is still only checking address creation with only a SSN. It would be nice if any of you in sweden could add a test case for POI.
I hope you will be able to try this. z.
[1] http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=ec5409ca4f46c308... [2] http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=13cd1199b92b9824... [3] http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=6ecf8104c0e2fd6e...
This is a simple test for poi in sccp_create_sccp_addr. I also try to test gti, but I always get Segmentation fault. I use gdb and find it stops in line 512. I can print the value of sock->gti_len, i don't know what's wrong.
512 gti = msgb_put(msg, sock->gti_len); 513 memcpy(gti, sock->gti, sock->gti_len);
Wenbin WU Uppsala University, Sweden
On Wed, Nov 17, 2010 at 8:33 AM, Wenbin Wu wenbin87@gmail.com wrote:
Hi Holger,
I will try to do this next week, since I have something to do this week. Thanks for noticing.
On 2010-11-16, at 下午9:02, Holger Hans Peter Freyther wrote:
On 10/21/2010 10:23 AM, Wenbin Wu wrote:
Hello,
Hi,
it would be nice if you could test the latest version of libosmo-sccp. I
have
made the sccp_create_addr public[1], I have changed the creation of the address to set the size correctly[2] and I have used the return value of
the
sccp_create_addr[3] to update the variable_called and such.
The added test case in [2] is still only checking address creation with
only a
SSN. It would be nice if any of you in sweden could add a test case for
POI.
I hope you will be able to try this. z.
[1]
http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=ec5409ca4f46c308...
[2]
http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=13cd1199b92b9824...
[3]
http://git.osmocom.org/gitweb?p=libosmo-sccp.git;a=commit;h=6ecf8104c0e2fd6e...
On 11/23/2010 11:31 AM, Wenbin Wu wrote:
This is a simple test for poi in sccp_create_sccp_addr. I also try to test gti, but I always get Segmentation fault. I use gdb and find it stops in line 512. I can print the value of sock->gti_len, i don't know what's wrong.
512 gti = msgb_put(msg, sock->gti_len); 513 memcpy(gti, sock->gti, sock->gti_len);
In the best case you have not set gti_len to the right size. I have applied your patch for the POI and I have added a test case and a small fix (setting the SSN indicator bit) for the GTI case. It appears to work, please compare my testcase with the code that failed for you.
thanks holger