[asterisk-ss7] bug in ss7 with linkset (slc) not equal to 0

Matthew Fredrickson creslin at digium.com
Mon May 14 08:19:45 MST 2007


On May 11, 2007, at 8:26 PM, sai jayram AKV wrote:

> hi.
> we have corrected a bug in ss7 stack when slc is not equal to 0.
>  
> File : mtp3.c
> Function : set_routinglabel
>  
> Old code :
>  
>                 case SS7_ITU:
>                         buf[0] = rl->dpc & 0xff;
>                         buf[1] = ((rl->dpc >> 8) & 0x3f) | ((rl->opc 
> << 6) & 0xc0);
>                         buf[2] = (rl->opc >> 2) & 0xff;
>                         buf[3] = ((rl->opc >> 10) & 0x0f) | (rl->sls & 
> 0xf0);
>                         return 4;
>  
>  
>  
> Modified code:
>  
>                 case SS7_ITU:
>                         buf[0] = rl->dpc & 0xff;
>                         buf[1] = ((rl->dpc >> 8) & 0x3f) | ((rl->opc 
> << 6) & 0xc0);
>                         buf[2] = (rl->opc >> 2) & 0xff;
>                         buf[3] = ((rl->opc >> 10) & 0x0f) | ((rl->sls 
> <<4) & 0xf0);
>                         return 4;
>  
> Slc/sls should occupy upper nibble position as specified by ITU.

Good catch.  I just confirmed the bug and committed a fix to it.

Matthew Fredrickson



More information about the asterisk-ss7 mailing list