Skip to contentSkip to conversation

bpf: fix bpf_skb_set_tunnel_key() helper

PATCH Applied Alexei Starovoitov 2 participants 2 messages Aug 26, 2015 – Aug 27, 2015

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

PATCH 1/1 bpf: fix bpf_skb_set_tunnel_key() helper

Make sure to indicate to tunnel driver that key.tun_id is set, otherwise gre won't recognize the metadata.

Fixes d3aa45ce6b94 ("bpf: add helpers to access tunnel metadata")

---
With this fix both vxlan and gretap are working with tc+bpf.

 net/core/filter.c |    1 +
 1 file changed, 1 insertion(+)
net/core/filter.c +1 -0
index b4adc961413f..66500d490995 100644
@@ -1528,6 +1528,7 @@ static u64 bpf_skb_set_tunnel_key(u64 r1, u64 r2, u64 size, u64 flags, u64 r5)
 
 	info = &md->u.tun_info;
 	info->mode = IP_TUNNEL_INFO_TX;
+	info->key.tun_flags = TUNNEL_KEY;
 	info->key.tun_id = cpu_to_be64(from->tunnel_id);
 	info->key.u.ipv4.dst = cpu_to_be32(from->remote_ipv4);
 
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw

From: Alexei Starovoitov <[email protected]>
Date: Wed, 26 Aug 2015 15:57:38 -0700

Quoted 7 lines

Make sure to indicate to tunnel driver that key.tun_id is set, otherwise gre won't recognize the metadata.

Fixes d3aa45ce6b94 ("bpf: add helpers to access tunnel metadata")

---
With this fix both vxlan and gretap are working with tc+bpf.

Applied, thanks.