Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77a482bd authored by Timo Teräs's avatar Timo Teräs Committed by David S. Miller
Browse files

ip_gre: fix ipgre_header to return correct offset



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 c5441932
("GRE: Refactor GRE tunneling code.")

Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarTimo Teräs <timo.teras@iki.fi>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 75848d33
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
	if (daddr)
		memcpy(&iph->daddr, daddr, 4);
	if (iph->daddr)
		return t->hlen;
		return t->hlen + sizeof(*iph);

	return -(t->hlen + sizeof(*iph));
}