All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed
@ 2017-12-14 16:05 Haishuang Yan
  2017-12-14 16:05 ` [PATCH 2/2] ip6_gre: fix error path when ip6erspan_rcv failed Haishuang Yan
  2017-12-14 18:25 ` [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed William Tu
  0 siblings, 2 replies; 4+ messages in thread
From: Haishuang Yan @ 2017-12-14 16:05 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI
  Cc: netdev, linux-kernel, Haishuang Yan, William Tu

When erspan_rcv call return PACKET_REJECT, we shoudn't call ipgre_rcv to
process packets again, instead send icmp unreachable message in error
path.

Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN")
Cc: William Tu <u9012063@gmail.com>
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv4/ip_gre.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 9253d6f..61ee014 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -411,11 +411,13 @@ static int gre_rcv(struct sk_buff *skb)
 	if (unlikely(tpi.proto == htons(ETH_P_ERSPAN))) {
 		if (erspan_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)
 			return 0;
+		goto out;
 	}
 
 	if (ipgre_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)
 		return 0;
 
+out:
 	icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
 drop:
 	kfree_skb(skb);
-- 
1.8.3.1

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

* [PATCH 2/2] ip6_gre: fix error path when ip6erspan_rcv failed
  2017-12-14 16:05 [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed Haishuang Yan
@ 2017-12-14 16:05 ` Haishuang Yan
  2017-12-14 18:27   ` William Tu
  2017-12-14 18:25 ` [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed William Tu
  1 sibling, 1 reply; 4+ messages in thread
From: Haishuang Yan @ 2017-12-14 16:05 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI
  Cc: netdev, linux-kernel, Haishuang Yan, William Tu

Same as ipv4 code, when ip6erspan_rcv call return PACKET_REJECT, we
should call icmpv6_send to send icmp unreachable message in error path.

Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
Cc: William Tu <u9012063@gmail.com>
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv6/ip6_gre.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index b8b0e4b..68e7eef 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -580,12 +580,13 @@ static int gre_rcv(struct sk_buff *skb)
 	if (unlikely(tpi.proto == htons(ETH_P_ERSPAN))) {
 		if (ip6erspan_rcv(skb, hdr_len, &tpi) == PACKET_RCVD)
 			return 0;
-		goto drop;
+		goto out;
 	}
 
 	if (ip6gre_rcv(skb, &tpi) == PACKET_RCVD)
 		return 0;
 
+out:
 	icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0);
 drop:
 	kfree_skb(skb);
-- 
1.8.3.1

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

* Re: [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed
  2017-12-14 16:05 [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed Haishuang Yan
  2017-12-14 16:05 ` [PATCH 2/2] ip6_gre: fix error path when ip6erspan_rcv failed Haishuang Yan
@ 2017-12-14 18:25 ` William Tu
  1 sibling, 0 replies; 4+ messages in thread
From: William Tu @ 2017-12-14 18:25 UTC (permalink / raw)
  To: Haishuang Yan
  Cc: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	linux-kernel, Linux Kernel Network Developers

On Thu, Dec 14, 2017 at 8:05 AM, Haishuang Yan
<yanhaishuang@cmss.chinamobile.com> wrote:
> When erspan_rcv call return PACKET_REJECT, we shoudn't call ipgre_rcv to
> process packets again, instead send icmp unreachable message in error
> path.
>
> Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN")
> Cc: William Tu <u9012063@gmail.com>
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
> ---

Thanks for the patch.
Acked-by: William Tu <u9012063@gmail.com>

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

* Re: [PATCH 2/2] ip6_gre: fix error path when ip6erspan_rcv failed
  2017-12-14 16:05 ` [PATCH 2/2] ip6_gre: fix error path when ip6erspan_rcv failed Haishuang Yan
@ 2017-12-14 18:27   ` William Tu
  0 siblings, 0 replies; 4+ messages in thread
From: William Tu @ 2017-12-14 18:27 UTC (permalink / raw)
  To: Haishuang Yan
  Cc: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	linux-kernel, Linux Kernel Network Developers

On Thu, Dec 14, 2017 at 8:05 AM, Haishuang Yan
<yanhaishuang@cmss.chinamobile.com> wrote:
> Same as ipv4 code, when ip6erspan_rcv call return PACKET_REJECT, we
> should call icmpv6_send to send icmp unreachable message in error path.
>
> Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
> Cc: William Tu <u9012063@gmail.com>
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
> ---

Looks good to me. Thanks.
Acked-by: William Tu <u9012063@gmail.com>

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

end of thread, other threads:[~2017-12-14 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 16:05 [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed Haishuang Yan
2017-12-14 16:05 ` [PATCH 2/2] ip6_gre: fix error path when ip6erspan_rcv failed Haishuang Yan
2017-12-14 18:27   ` William Tu
2017-12-14 18:25 ` [PATCH 1/2] ip_gre: fix error path when erspan_rcv failed William Tu

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.