[PATCH libosmo-netif 07/18] osmux: count pending messages to be transformed in the batch

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/.

Pablo Neira Ayuso pablo at gnumonks.org
Mon Aug 10 08:10:12 UTC 2015


On Sat, Aug 08, 2015 at 09:00:30PM +0200, Holger Freyther wrote:
> 
> > On 21 Jul 2015, at 16:23, pablo at gnumonks.org wrote:
> > 
> > From: Pablo Neira Ayuso <pablo at soleta.eu>
> > 
> > Add a new field to count the number of messages in the batch that are pending
> > to be transformed to osmux. Use this new field to check when to enable the
> > osmux timer.
> 
> okay, when one counts a list one needs to be careful to have it balanced. While
> having a look if it is balanced I noticed this in the original code:
> 
> static struct msgb *osmux_build_batch(struct osmux_in_handle *h)
> {
> 
>> 
> 
>         llist_for_each_entry_safe(node, tnode, &batch->node_list, head) {
>                 struct msgb *cur, *tmp;
>                 int ctr = 0;
> 
>                 llist_for_each_entry_safe(cur, tmp, &node->list, list) {
>                         struct rtp_hdr *rtph;
>                         int add_osmux_hdr = 0;
> 
> #ifdef DEBUG_MSG
> ...
> #endif
> 
>                         rtph = osmo_rtp_get_hdr(cur);
>                         if (rtph == NULL)
>                                 return NULL;
> 
> 
> When and how will this package be dropped?

If the RTP message that we received is malformed.

Although we already checked this when enqueuing the packet into the
circuit list before the transformation happens, so it should be safe
to remove the NULL check.

But let me revisit this in a follow up patch.

> Patches 4-7 look good too!

Thanks Holger.



More information about the OpenBSC mailing list