diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-08-06 06:45:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-14 09:54:54 -0400 |
commit | 27c1c98bd3b44b7c5f5c0ecfe1a1ec1240b73829 (patch) | |
tree | d54bf1787f5456beddfea075cfd2b36efae1a890 /net | |
parent | 24e8ac721e0e13cab478bd190977daac48b6146c (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_gre.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 855004f08325..c52fee0976da 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -572,7 +572,7 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev, | |||
572 | if (daddr) | 572 | if (daddr) |
573 | memcpy(&iph->daddr, daddr, 4); | 573 | memcpy(&iph->daddr, daddr, 4); |
574 | if (iph->daddr) | 574 | if (iph->daddr) |
575 | return t->hlen; | 575 | return t->hlen + sizeof(*iph); |
576 | 576 | ||
577 | return -(t->hlen + sizeof(*iph)); | 577 | return -(t->hlen + sizeof(*iph)); |
578 | } | 578 | } |