[sr-dev] [kamailio/kamailio] dispatcher algorithm 11 with congestion control memory corruption problem (#1649)

Julien Chavanton notifications at github.com
Fri Sep 21 19:18:54 CEST 2018


The lock was set to 0 else it would have been 48 times 2

```
   /* if the array was not completely filled (i.e., the sum of rweights is
    * less than 100 due to truncated), then use last address to fill the rest */
   unsigned int last_insert =
         t > 0 ? dset->rwlist[t - 1] : (unsigned int)(dset->nr - 1);
   for(j = t; j < 100; j++)
      dset->rwlist[j] = last_insert;

   /* shuffle the content of the array in order to mix the selection
    * of the addresses (e.g., if first address has weight=20, avoid
    * sending first 20 calls to it, but ensure that within a 100 calls,
    * 20 go to first address */
   shuffle_uint100array(dset->rwlist);
   lock_release(&dset->lock);
   return 0;
}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1649#issuecomment-423610648
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180921/dcf4b873/attachment-0001.html>


More information about the sr-dev mailing list