Files
linux/net
Eric Dumazet c5a07578be netpoll: fix netpoll_send_udp() bugs
[ Upstream commit 954fba0274 ]

Bogdan Hamciuc diagnosed and fixed following bug in netpoll_send_udp() :

"skb->len += len;" instead of "skb_put(skb, len);"

Meaning that _if_ a network driver needs to call skb_realloc_headroom(),
only packet headers would be copied, leaving garbage in the payload.

However the skb_realloc_headroom() must be avoided as much as possible
since it requires memory and netpoll tries hard to work even if memory
is exhausted (using a pool of preallocated skbs)

It appears netpoll_send_udp() reserved 16 bytes for the ethernet header,
which happens to work for typicall drivers but not all.

Right thing is to use LL_RESERVED_SPACE(dev)
(And also add dev->needed_tailroom of tailroom)

This patch combines both fixes.

Many thanks to Bogdan for raising this issue.

Reported-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 08:47:38 -07:00
..
2011-05-23 16:29:24 -04:00
2011-11-11 09:36:45 -08:00
2011-07-19 11:25:04 -07:00
2012-07-16 08:47:38 -07:00
2011-03-14 17:02:42 -07:00
2011-03-17 11:59:32 +11:00
2011-03-21 18:16:39 -07:00
2011-05-24 01:13:12 -04:00
2012-04-02 09:27:21 -07:00
2012-05-21 09:39:59 -07:00
2011-05-24 01:13:12 -04:00
2011-03-31 11:26:23 -03:00
2012-06-10 00:33:02 +09:00
2011-05-05 11:10:14 -07:00
2011-04-29 10:20:53 -07:00
2010-10-15 15:53:27 +02:00