net: fix setting of skb->tail in skb_recycle_check()

Since skb_reset_tail_pointer() reads skb->data, we need to set
skb->data before calling skb_reset_tail_pointer().  This was causing
spurious skb_over_panic()s from skb_put() being called on a recycled
skb that had its skb->tail set to beyond where it should have been.

Bug report from Peter van Valderen <linux@ddcrew.com>.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Lennert Buytenhek 2008-11-10 21:45:05 -08:00 коммит произвёл David S. Miller
Родитель b971e7ac83
Коммит 5cd33db212
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -486,8 +486,8 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size)
shinfo->frag_list = NULL;
memset(skb, 0, offsetof(struct sk_buff, tail));
skb_reset_tail_pointer(skb);
skb->data = skb->head + NET_SKB_PAD;
skb_reset_tail_pointer(skb);
return 1;
}