ip_gre: fix ipgre_header to return correct offset MIME-Version: 1.0
authorTimo Teräs <timo.teras@iki.fi>
Tue, 6 Aug 2013 10:45:43 +0000 (13:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Sep 2013 13:54:54 +0000 (06:54 -0700)
commit27c1c98bd3b44b7c5f5c0ecfe1a1ec1240b73829
treed54bf1787f5456beddfea075cfd2b36efae1a890
parent24e8ac721e0e13cab478bd190977daac48b6146c
ip_gre: fix ipgre_header to return correct offset MIME-Version: 1.0

[ Upstream commit 77a482bdb2e68d13fae87541b341905ba70d572b ]

Fix ipgre_header() (header_ops->create) to return the correct
amount of bytes pushed. Most callers of dev_hard_header() seem
to care only if it was success, but af_packet.c uses it as
offset to the skb to copy from userspace only once. In practice
this fixes packet socket sendto()/sendmsg() to gre tunnels.

Regression introduced in c54419321455631079c7d6e60bc732dd0c5914c5
("GRE: Refactor GRE tunneling code.")

Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/ip_gre.c