On Thu, 2012-09-20 at 13:40 +0800, RongQing Li wrote:
quoted
quoted
unsigned int offset;
This is not needed at all.
I think the below modification maybe needed,
if (len <= skb_tailroom(to) && !skb_shinfo(to)->nr_frags) {
..
}
First skb A is added to skb TO frags, since the len is larger
than skb_tailroot(TO), but second len of skb B is less than
skb_tailroot(To) which will call skb_copy_bits.
Of cause, this kinds of cases maybe only exist on my mind.
Did you read skb_tailroom(to) definition by any chance ?
static inline int skb_tailroom(const struct sk_buff *skb)
{
return skb_is_nonlinear(skb) ? 0 : skb->end - skb->tail;
}
Current code is fine, because if @to is linear, its ... linear.