Ido reported that the commit referenced in the Fixes tag broke a gre use case with dummy devices. Add a check to ip_tunnel_init_flow to see if the oif is an l3mdev port and if so set the oif to 0 to avoid the oif comparison in fib_lookup_good_nhc.
Showing the changes to include (1 of 4 files). Show all
Unified · Split
| @@ -243,11 +243,18 @@ static inline __be32 tunnel_id_to_key32(__be64 tun_id) · 242 unmodified lines | |||
| 243 | static inline void ip_tunnel_init_flow(struct flowi4 *fl4, | 243 | static inline void ip_tunnel_init_flow(struct flowi4 *fl4, |
| 244 | int proto, | 244 | int proto, |
| 245 | __be32 daddr, __be32 saddr, | 245 | __be32 daddr, __be32 saddr, |
| 246 | __be32 key, __u8 tos, int oif, | 246 | __be32 key, __u8 tos, |
| 247 | struct net *net, int oif, | ||
| 247 | __u32 mark, __u32 tun_inner_hash) | 248 | __u32 mark, __u32 tun_inner_hash) |
| 248 | { | 249 | { |
| 249 | memset(fl4, 0, sizeof(*fl4)); | 250 | memset(fl4, 0, sizeof(*fl4)); |
| 250 | fl4->flowi4_oif = oif; | 251 | |
| 252 | if (oif) { | ||
| 253 | fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index_rcu(net, oif); | ||
| 254 | /* Legacy VRF/l3mdev use case */ | ||
| 255 | fl4->flowi4_oif = fl4->flowi4_l3mdev ? 0 : oif; | ||
| 256 | } | ||
| 257 | |||
| 251 | fl4->daddr = daddr; | 258 | fl4->daddr = daddr; |
| 252 | fl4->saddr = saddr; | 259 | fl4->saddr = saddr; |
| 253 | fl4->flowi4_tos = tos; | 260 | fl4->flowi4_tos = tos; |