pktgen: Fix position of ip and udp header
authorThomas Graf <tgraf@suug.ch>
Mon, 3 Jun 2013 11:49:23 +0000 (11:49 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Jun 2013 00:35:45 +0000 (17:35 -0700)
commit525cebedb32a87fa48584bc44e14170beb2c10d1
tree17a3e08c3768f02e8dd59ad0583c2bba17c4d4db
parent10e179e364beafc23d837e81cf98d99720f42551
pktgen: Fix position of ip and udp header

skb_set_network_header() expects an offset based on the data pointer
whereas skb_tail_offset() also includes the headroom. This resulted
in the ip header being written in a wrong location.

Use return values of skb_put() directly and rely on skb->len to
set mac, network, and transport header.

Cc: Simon Horman <horms@verge.net.au>
Cc: Daniel Borkmann <dborkmann@redhat.com>
Assisted-by: Daniel Borkmann <dborkmann@redhat.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Daniel Borkmann <dborkmann@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c