Hello David,
On Sat, Nov 26, 2011 at 02:41:22 -0500, David Miller wrote: [CUT]
Some things to look into:
if (unlikely(skb_headlen(skb) <
sizeof(struct tt_query_packet) +
tt_len))
This isn't formatted correctly, all the leading edges should line up to the openning parenthesis of the unlikely:
if (unlikely(skb_headlen(skb) <
sizeof(struct tt_query_packet) +
tt_len))
Thank you for reporting this issue. We have already prepared a patch which is going to be sent within the next batch.
Next, there is a lot of linearization done by the stack, but really the thing to do is to make sure that the part you want to look at is linear.
You do this using pskb_may_pull() right before you want to look at some headers. It makes sure that, for the length given, that many bytes are linear at the head of the skb.
For this issue, we had some problem to understand it.
First of all I think you are referring to patch 08/10, in which I moved a skb_linearise() operation.
To be sure it is really needed, I backtracked the code flow and noted down any eventual psbk_may_pull() (or any other linearisation operation). The result is:
=> in batman_skb_recv() - pskb_may_pull(2) => in recv_tt_query() - pskb_may_pull(sizeof(header)) - skb_linearise()
Actually it seems we haven't any useless linearisation. Would you mind explain us where you actually found the problem, please?
It might also be that I misunderstood your advice.
Thank you.
Best Regards,