All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] ip_gre: fix ipgre_header to return correct offset
@ 2013-08-06 10:45 Timo Teräs
  2013-08-06 11:37 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Timo Teräs @ 2013-08-06 10:45 UTC (permalink / raw)
  To: netdev; +Cc: Timo Teräs, Pravin B Shelar

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>
---
Should go to 3.10-stable too. Without this dmvpn setup does not work
at all, as opennhrp uses packet sockets to send the nhrp packets.

 net/ipv4/ip_gre.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 855004f..c52fee0 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,
 	if (daddr)
 		memcpy(&iph->daddr, daddr, 4);
 	if (iph->daddr)
-		return t->hlen;
+		return t->hlen + sizeof(*iph);
 
 	return -(t->hlen + sizeof(*iph));
 }
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ip_gre: fix ipgre_header to return correct offset
  2013-08-06 10:45 [PATCH net] ip_gre: fix ipgre_header to return correct offset Timo Teräs
@ 2013-08-06 11:37 ` Eric Dumazet
  2013-08-09 18:06   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-08-06 11:37 UTC (permalink / raw)
  To: Timo Teräs; +Cc: netdev, Pravin B Shelar

On Tue, 2013-08-06 at 13:45 +0300, Timo Teräs wrote:
> 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>
> ---
> Should go to 3.10-stable too. Without this dmvpn setup does not work
> at all, as opennhrp uses packet sockets to send the nhrp packets.
> 
>  net/ipv4/ip_gre.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ip_gre: fix ipgre_header to return correct offset
  2013-08-06 11:37 ` Eric Dumazet
@ 2013-08-09 18:06   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-08-09 18:06 UTC (permalink / raw)
  To: eric.dumazet; +Cc: timo.teras, netdev, pshelar

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 06 Aug 2013 04:37:13 -0700

> On Tue, 2013-08-06 at 13:45 +0300, Timo Teräs wrote:
>> 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>
>> ---
>> Should go to 3.10-stable too. Without this dmvpn setup does not work
>> at all, as opennhrp uses packet sockets to send the nhrp packets.
>> 
>>  net/ipv4/ip_gre.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-09 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 10:45 [PATCH net] ip_gre: fix ipgre_header to return correct offset Timo Teräs
2013-08-06 11:37 ` Eric Dumazet
2013-08-09 18:06   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.