Skip to contentSkip to conversation

ip6_gre: fix flowi6_proto value in xmit path

PATCH In review Nicolas Dichtel 2 participants 2 messages Oct 2, 2014 – Oct 5, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip6_gre: fix flowi6_proto value in xmit path

In xmit path, we build a flowi6 which will be used for the output route lookup. We are sending a GRE packet, neither IPv4 nor IPv6 encapsulated packet, thus the protocol should be IPPROTO_GRE.

Fixes c12b395a4664 ("gre: Support GRE over IPv6")
---
 net/ipv6/ip6_gre.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/ip6_gre.c +2 -2
index f304471477dc..97299d76c1b0 100644
@@ -782,7 +782,7 @@ static inline int ip6gre_xmit_ipv4(struct sk_buff *skb, struct net_device *dev)
 		encap_limit = t->parms.encap_limit;
 
 	memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
-	fl6.flowi6_proto = IPPROTO_IPIP;
+	fl6.flowi6_proto = IPPROTO_GRE;
 
 	dsfield = ipv4_get_dsfield(iph);
 
@@ -832,7 +832,7 @@ static inline int ip6gre_xmit_ipv6(struct sk_buff *skb, struct net_device *dev)
 		encap_limit = t->parms.encap_limit;
 
 	memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
-	fl6.flowi6_proto = IPPROTO_IPV6;
+	fl6.flowi6_proto = IPPROTO_GRE;
 
 	dsfield = ipv6_get_dsfield(ipv6h);
 	if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
Signature · 1 line
2.1.0
maintainer
#1 lore raw

From: Nicolas Dichtel <[email protected]>
Date: Thu, 2 Oct 2014 18:26:49 +0200

Quoted 7 lines

In xmit path, we build a flowi6 which will be used for the output route lookup. We are sending a GRE packet, neither IPv4 nor IPv6 encapsulated packet, thus the protocol should be IPPROTO_GRE.

Fixes c12b395a4664 ("gre: Support GRE over IPv6")

Applied and queued up for -stable, thanks.