Bug#721147: Potential fix (state: works for me)

Karsten Richter kasi at kasi-net.org
Fri Feb 13 11:45:55 UTC 2015


Hi, 

I also experienced this bug on my machine (bug is still present in latest dahdi-linux code in SID), so I investigated a bit into the code. 

Analysis: 

I recognized that the sk_buff at first sight is needed in both cases of the if statement, 
but the memcpy to the sk_buff in the true case is totally pointless as the data is not passed on at all.
It seems to be a relic of the software based HDLC times, when we passed the frame data on to the dahdi-hdlc code.

The struct sk_buff is only used as a temporary buffer to remove the frame from the FIFO without any further processing, if the channel is not open.

Patch:

1. Replace the struct sk_buff with a plain void * that is only allocated when needed. It’s a throw away buffer, so no need the added complexity of sk_buff.
2. Remove memcpy which copies frame data from the channel buffer to the SKB in the channel open case.
3. As a consequence of (2) the alloc/dealloc code is moved into the channel closed case of the if statement.

The attached patch is tested successfully on my live EDSS1 line here in Germany. 


Kind Regards

Karsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 721147.patch
Type: application/octet-stream
Size: 2410 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-voip-maintainers/attachments/20150213/fbc02bb7/attachment.obj>


More information about the Pkg-voip-maintainers mailing list